Move word config to configureDefaults

This commit is contained in:
Andrew Miner
2018-05-28 20:33:34 -06:00
parent 302a9b2c3a
commit e2488b0abb
+12 -11
View File
@@ -8,6 +8,18 @@ configureDefaults = (story)->
story.addVerb "look", (sentence)-> story.look(sentence) story.addVerb "look", (sentence)-> story.look(sentence)
story.addVerb "restart", -> story.reset() story.addVerb "restart", -> story.reset()
parser = story.parser
parser.addDirections(
"north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest", "up", "down"
)
parser.addFillerWords(
"a", "all", "an", "around", "at", "everything", "of", "it", "the", "to", "thing"
)
parser.addAliases({
"d": "down", "e": "east", "g": "go", "i": "inventory", "l": "look", "n": "north", "ne": "northeast",
"nw": "northwest", "s": "south", "se": "southeast", "sw": "southwest", "u": "up", "w": "west",
})
######################################################################################################################## ########################################################################################################################
class Actor class Actor
@@ -553,17 +565,6 @@ class Story extends Actor
@parser.reset() @parser.reset()
@player.reset() @player.reset()
@parser.addDirections(
"north", "northeast", "east", "southeast", "south", "southwest", "west", "northwest", "up", "down"
)
@parser.addFillerWords(
"a", "all", "an", "around", "at", "everything", "of", "the", "to"
)
@parser.addAliases({
"d": "down", "e": "east", "g": "go", "i": "inventory", "l": "look", "n": "north", "ne": "northeast",
"nw": "northwest", "s": "south", "se": "southeast", "sw": "southwest", "u": "up", "w": "west",
})
configureDefaults(this) configureDefaults(this)
@onRestart() @onRestart()