[Greenengine-developer] Minor adjustments, better Print function
Status: Planning
Brought to you by:
jeromiya
|
From: Jeremy B. <bel...@gm...> - 2007-04-17 00:35:57
|
Just added some improvements to the Print function of EntityTemplate, which now prints information about its BehaviorTemplate list, and also the VariableTableTemplate base class now also prints out the InitFormat as well. NOTE: Variable::Value objects are printed in this form "(<intVal>, <floatVal>)" so I don't have to pass the type every time I want to print a Value. Also, you can now add BehaviorTemplates to EntityTemplate using the name rather than the key by using the new overloaded method: void EntityTemplate::AddBehavior(const Name& name, ArgListPtr args); // add a behavior to the list with Name name (and Key 0) You can get the name back from the template with: const Name& EntityTemplate::GetBehaviorName(size_t behavior); // get the nth behavior's name And you can set the Key for the behavior later on with: void EntityTemplate::SetBehaviorKey(size_t behavior, Key key); // set the nth behavior's Key to key I've got code in GRunApplication::Init that demonstrates creating a BehaviorTemplate and an EntityTemplate and adding them to the BehaviorTemplateTable and EntityTemplateTable (and also printing them out) and also Instantiating the EntityTemplate, so you can take a look at that to see how to do it all. Regards, Jeremy |