23 lines
428 B
JavaScript
23 lines
428 B
JavaScript
|
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() {
|
||
|
this._currentWord += 1;
|
||
|
}
|
||
|
}
|