summaryrefslogtreecommitdiff
path: root/play.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-10-10 15:56:25 +0200
committerTor Andersson <tor@ccxvii.net>2023-12-10 18:16:55 +0100
commit9563a8ab99a4c91f61a4c509316a8824d882610f (patch)
tree210a79fcbe83fc38ca8910c87552be0e99f6814a /play.js
parent0c3345f1d664ad53c5bafec61070010d004732bf (diff)
downloadplantagenet-9563a8ab99a4c91f61a4c509316a8824d882610f.tar.gz
Use accessors in play.js
Diffstat (limited to 'play.js')
-rw-r--r--play.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/play.js b/play.js
index 270e162..46af623 100644
--- a/play.js
+++ b/play.js
@@ -294,7 +294,7 @@ function get_locale_tip(id) {
function on_focus_cylinder(evt) {
let lord = evt.target.my_id
let info = data.lords[lord]
- let loc = view.pieces.locale[lord]
+ let loc = get_lord_locale(lord)
let tip = info.name
on_focus(tip)
}
@@ -1189,7 +1189,7 @@ function update_lord_mat(ix) {
}
function update_lord(ix) {
- let locale = view.pieces.locale[ix]
+ let locale = get_lord_locale(ix)
if (locale < 0) {
ui.lord_cylinder[ix].classList.add("hide")
ui.lord_mat[ix].classList.remove("action")
@@ -1389,10 +1389,10 @@ function update_cards() {
ui.lord_capabilities[ix].replaceChildren()
ui.lord_events[ix].replaceChildren()
if (view.reveal & (1 << ix)) {
- let c = view.pieces.capabilities[(ix << 1) + 0]
+ let c = get_lord_capability(ix, 0)
if (c >= 0)
ui.lord_capabilities[ix].appendChild(ui.cards[c])
- c = view.pieces.capabilities[(ix << 1) + 1]
+ c = get_lord_capability(ix, 1)
if (c >= 0)
ui.lord_capabilities[ix].appendChild(ui.cards[c])
if (view.battle && view.battle.field_organ === ix)
@@ -1482,7 +1482,7 @@ function on_update() {
locale_layout[i].length = 0
for (let ix = 0; ix < data.lords.length; ++ix) {
- if (view.pieces.locale[ix] < 0) {
+ if (get_lord_locale(ix) < 0) {
ui.lord_cylinder[ix].classList.add("hide")
} else {
ui.lord_cylinder[ix].classList.remove("hide")