summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorZhineng Li <[email protected]>2026-04-30 14:10:27 +0800
committerZhineng Li <[email protected]>2026-04-30 14:10:27 +0800
commit05b1267f91d07704aa749bd64c3c289afddc7546 (patch)
tree376bb33ec2c3c1c695408e18232bfc3be005683f /js
parent68c9b7560642c802ca3bfe6d7e0f7a8c54412c40 (diff)
downloadword-search-game-05b1267f91d07704aa749bd64c3c289afddc7546.tar.gz
word-search-game-05b1267f91d07704aa749bd64c3c289afddc7546.zip
rename class from `WordSearch` to `Game`
Diffstat (limited to 'js')
-rw-r--r--js/wordsearch.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/js/wordsearch.js b/js/wordsearch.js
index c3390af..491c3de 100644
--- a/js/wordsearch.js
+++ b/js/wordsearch.js
@@ -588,7 +588,7 @@ class Handler {
}
}
-class WordSearch {
+class Game {
static #directions = DIRECTIONS;
/**
@@ -642,10 +642,10 @@ class WordSearch {
}
this.#settings = {
- ...WordSearch.#defaultSettings,
+ ...Game.#defaultSettings,
...settings,
colors: {
- ...WordSearch.#defaultSettings.colors,
+ ...Game.#defaultSettings.colors,
...(settings.colors && typeof settings.colors === 'object' ? settings.colors : {}),
},
};
@@ -723,7 +723,7 @@ class WordSearch {
* @returns {boolean}
*/
#placeWord(word, direction) {
- const step = WordSearch.#directions[direction];
+ const step = Game.#directions[direction];
if (!step) {
return false;
}
@@ -871,4 +871,4 @@ class WordSearch {
}
}
-export { WordSearch };
+export { Game };