MAIN CONTROLLER
The Main Controller is a top-level script in the scene that handles all incoming messages (in our case, from Ignition). From these messages, the Main Controller ascertains what modules need to go in, which modules are already in and need to update, and which modules are currently in but need to go out. Once these actions have been derived, they are sent to each sub-controller:
SUB-CONTROLLERS
A sub-controller is a script that is responsible for one discrete module. The Main Controller treats each sub-controller as a “black box” – it doesn’t know about methods specific to that controller, just a standard interface. The following three methods are expected on each sub controller:
GoIn
The “Go In” method is called by the Main Controller if a module is not already in.
This method is passed the current “state” of the module (data containing all the information about that graphic – the format and structure of which is decided upon collaboratively between us and the builder of the graphics).
An “immediate” flag is also sent to provide instant feedback for previews where animating to the current state is not necessary.
Update
The “Update” method is called if a module is thought to already be in. Here, as with the “GoIn” method, the “state” parameter contains all of the information about the current state of the graphic.
It is the responsibility of the Update method to check for changes in the state and perform the appropriate actions.
GoOut
The “GoOut” method is called to take a module out if it is In. There is no “state” parameter required for this method.