
As mentioned previously, the TickHandler can receive tick events from the GameObjectCollector. We previously discussed Tickhandler, but now we will cover its two direct subclasses: GameObject and PyTickHandler.
GameObject
GameObject (GameObjectCollector *c)
GameObject (GameObjectCollector *c, const string &grid)
GameObject (GameObjectCollector *c, const char *rGrid)
GOComponent * GetGOC (const char *rFamilyID)
GOComponent * GetGOC (const string &familyID)
void SetGOC (GOComponent *newGOC)
void DelGOC (const char *rFamilyID)
void DelGOC (const string &familyID)
void ClearGOCs ()
void SetLocation (GameMapLocation *gloc)
GameMapLocation * GetLocation ()
Point GetLocationPoint ()
GamePoint * GWGetLocation ()
bool Tick (TickPhase phase)
bool TestProposition (char *name, bool truth, float value)
void UpdateProposition (GameProposition &g)
void AddProposition (GameProposition *prop)
GameProposition * GetProposition (string &name, bool truth)
GameProposition * GetProposition (char *name, bool truth)
float Distance (GameObject *obj)
GameReferenceType GetReferenceType ()
GameObject is intended to be the first concrete class to be registered with the GameObjectCollector. It could be thought as an object in the game environment. It could represent both and actor or a tree. The GameObject uses a game object component system that is very similar to what is described in Game Programming Gems: 6. The components make up the specialized behavior of varios GameObjects, and will be covered in much more detail in my next post. It is the ability to set and get these components that allow some objects, an avatar for example, to have an Artificial Intelligence, and some objects, such as a trap, to have minimal intelligence.
PyTickHandler
PyTickHandler (PyObject *o, GameObjectCollector *c, const char *tid)
bool Tick (TickPhase phase)
This handler is very generic, and dellegates the handling of the Tick call to whatever python object is attached to this object. This allows a great deal of extensibility, as you can allow any python object to participate in the tick events of the GameObjectCollector. An example might be a timing component, a state renderer, or simply an object that resurrects fallen avatars as their deaths are detected in the tick event cycle.
