(function () {
var p = adventurejs.Game.prototype;
p.getWordCount = function Game_getWordCount() {
let unique_words = [];
let keys = Object.keys(this.world_lookup);
for (let index in keys) {
let key = keys[index];
let words = key.split(" ");
for (let ind in words) {
let word = words[ind];
if (-1 === word.indexOf("_") && -1 === unique_words.indexOf(word))
unique_words.push(word);
}
}
keys = Object.keys(this.dictionary.verb_lookup);
for (let index in keys) {
let word = keys[index];
if (-1 === unique_words.indexOf(word)) unique_words.push(word);
let sins = this.dictionary.verb_lookup[word].synonyms;
for (let s in sins) {
let sin = sins[s];
if (-1 === unique_words.indexOf(sin)) unique_words.push(sin);
}
}
unique_words = unique_words.concat(this.dictionary.adjectives);
unique_words = unique_words.concat(this.dictionary.adverbs);
unique_words = unique_words.concat(this.dictionary.prepositions);
return unique_words;
};
})();