summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-07-16 13:31:47 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-16 13:31:47 +0200
commit3d1a876b4fc7da13a58148f3bfa0e6ba9031b5e7 (patch)
tree59f0bff03021c79718aea1c2af367ccc93c110af
parentc48d9b2a54502f27b9abdb3ea70acf77c7349528 (diff)
downloadfield-cloth-gold-3d1a876b4fc7da13a58148f3bfa0e6ba9031b5e7.tar.gz
Fix eslint warnings.
Remove unused code.
-rw-r--r--play.js4
-rw-r--r--rules.js15
2 files changed, 6 insertions, 13 deletions
diff --git a/play.js b/play.js
index 34a0b6e..85179ae 100644
--- a/play.js
+++ b/play.js
@@ -1,12 +1,12 @@
"use strict"
-const FIRST_TILE = 1
+/* global view, player, send_action, action_button, scroll_with_middle_mouse */
+
const TILE_BLUE = 1
const TILE_RED = 13
const TILE_GOLD = 25
const TILE_WHITE = 37
const TILE_GREEN = 49
-const LAST_TILE = 54
const TILE_W = 56
const TILE_SPACE = TILE_W + 12
diff --git a/rules.js b/rules.js
index 58ccd1e..e41513d 100644
--- a/rules.js
+++ b/rules.js
@@ -44,7 +44,6 @@ const TILE_RED = 13
const TILE_GOLD = 25
const TILE_WHITE = 37
const TILE_GREEN = 49
-const LAST_TILE = 54
const COUNT_NAME = [
"no",
@@ -86,7 +85,7 @@ function tile_name(tile) {
if (tile >= TILE_RED && tile < TILE_RED + 12) return "red"
if (tile >= TILE_GOLD && tile < TILE_GOLD + 12) return "gold"
if (tile >= TILE_WHITE && tile < TILE_WHITE + 12) return "white"
- if (tile >= TILE_GREEN && tile < TILE_GREEN + 12) return "green"
+ if (tile >= TILE_GREEN && tile < TILE_GREEN + 6) return "green"
return "None"
}
@@ -501,7 +500,7 @@ states.move_token_to = {
return goto_collections()
}
},
- token(t) {
+ token(_) {
pop_undo()
},
}
@@ -534,7 +533,7 @@ states.return_dragon_1 = {
view.prompt = "End of Turn Move the Dragon back to its space."
gen_action_token(TOKEN_DRAGON)
},
- token(id) {
+ token(_) {
game.state = "return_dragon_2"
},
}
@@ -609,7 +608,7 @@ states.dragon_1 = {
view.prompt = "Dragon: Move the Dragon to an empty oval space."
gen_action_token(TOKEN_DRAGON)
},
- token(id) {
+ token(_) {
game.state = "dragon_2"
},
}
@@ -1215,9 +1214,3 @@ function array_remove_item(array, item) {
if (array[i] === item)
return array_remove(array, i)
}
-
-function array_insert(array, index, item) {
- for (let i = array.length; i > index; --i)
- array[i] = array[i - 1]
- array[index] = item
-}