Class: Messages

Messages


new Messages()

Create the instance managing the filesystem.
Source:

Members


<private, constant> _messageFile :string

The file path to read messages.
Type:
  • string
Default Value:
  • ./save/hgMessages.json
Source:

<private> _messages :object.<Array.<string>>

All messages to show for games. Parsed from file.
Type:
  • object.<Array.<string>>
Default Value:
  • {}
Source:

Methods


<private> _updateMessages()

Parse all messages from file.
Source:

get(type)

Get a random message of a given type from hgMessages.json.
Parameters:
Name Type Description
type string The message type to get.
Source:
Returns:
A random message of the given type.
Type
string

shutdown()

Stop watching for file changes.
Source: