CommandParser

Interpreter.. you guessed it, interprets command input

Constructor

new CommandParser()

Methods

static parse(state, data, player) → {Object}

Parse a given string to find the resulting command/arguments

Parameters:
Name Type Description
state GameState
data string
player Player
Returns:
Object

static parseDot(search, list, returnKey) → {*}

Parse "get 2.foo bar"

Parameters:
Name Type Default Description
search string

2.foo

list Iterable

Where to look for the item

returnKey boolean false

If list is a Map, true to return the KV tuple instead of just the entry

Returns:
* -

Boolean on error otherwise an entry from the list