2025-01-22 10:50:12 +00:00
|
|
|
export class WordSource {
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
this._words = [
|
|
|
|
"MUNCH",
|
|
|
|
"HOUSE",
|
|
|
|
"MOON"
|
|
|
|
];
|
|
|
|
this._currentWord = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
isWord(word) {
|
|
|
|
return this._words.filter((x) => x == word).length > 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
getCurrentWord() {
|
|
|
|
return this._words[this._currentWord];
|
|
|
|
}
|
|
|
|
|
|
|
|
nextWord() {
|
2025-01-22 11:04:24 +00:00
|
|
|
if (this._currentWord >= this._words.length - 1) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
this._currentWord += 1;
|
|
|
|
return true;
|
2025-01-22 10:50:12 +00:00
|
|
|
}
|
|
|
|
}
|