Class: Component

Component

new Component(type)

The Component class All game components should inherit from this class
Parameters:
Name Type Description
type int the type of messages that the component subscribes to
Source:

Methods

sendMessage(message) → {void}

Method to broadcast a message out to the other components
Parameters:
Name Type Description
message string Message to send
Source:
Returns:
Type
void

subscribe(callback) → {void}

Method to subscribe to messages
Parameters:
Name Type Description
callback func A callback method to pass the message to
Source:
Returns:
Type
void