green::EntityTemplate Class Reference

#include <EntityTemplate.h>

Inheritance diagram for green::EntityTemplate:

green::VariableTableTemplate green::KeyNameTable< entryType > List of all members.

Public Member Functions

void AddBehavior (Key behavior, ArgListPtr args)
void AddBehavior (const Name &name, ArgListPtr args)
void SetBehaviorKey (size_t behavior, Key key)
Key GetBehavior (size_t behavior) const
const NameGetBehaviorName (size_t behavior)
ArgListPtr GetBehaviorArgs (size_t behavior) const
size_t GetNumBehaviors () const
void addInitCode (UnresOpSeqPtr uInitCodeIn)
 This adds the unresolved init code to this entity.
UnresOpSeqPtr getInitCode ()
 This gets the unresolved init code from this entity.
void addResolvedInit (VariableTableTemplatePtr argList, OpSeqPtr resdCode)
 This adds resolved init code. This adds resolved code (OpSeq). It also as a hack adds the argList from the other arg list.
virtual void Print (std::ostream &os)

Protected Attributes

std::vector< _listEntry > mBehaviors
UnresOpSeqPtr unresInitCode
OpSeqPtr initCode

Classes

class  _listEntry

Detailed Description

An EntityTemplate is a template for an Entity in the scene. Entities have a list of behaviors associated with them, along with the initializer arguments to those behaviors. In addition, each Entity has a list of classifications that they belong to. These classifications can be referenced by Behaviors that want to send messages to a classification of objects.


Member Function Documentation

void green::EntityTemplate::AddBehavior ( Key  behavior,
ArgListPtr  args 
) [inline]

Add a behavior to the end of the behavior list.

Parameters:
behavior The behavior type to add.
args The ArgList to send to the behavior on instantiation.

void green::EntityTemplate::AddBehavior ( const Name name,
ArgListPtr  args 
) [inline]

Add a behavior to the end of the behavior list. Use this function when you only have the name, but not the key for the behavior. Later on you can call SetBehaviorKey to set the key once you know what it is

Parameters:
name The name of the behavior.
args The arguments you will use to instantiate the behavior.

void green::EntityTemplate::SetBehaviorKey ( size_t  behavior,
Key  key 
) [inline]

Set the key for a behavior you previously only knew the name for.

Parameters:
behavior the behavior number in this templates behavior list.
key The key of the behavior.

Key green::EntityTemplate::GetBehavior ( size_t  behavior  )  const [inline]

Get a specific behavior template from the list.

Parameters:
behavior The behavior number to get. Throws an Error if behavior is greater than the number of behaviors in the list.
Returns:
Returns the behavior asked for.

const Name& green::EntityTemplate::GetBehaviorName ( size_t  behavior  )  [inline]

Get the name of a behavior in this template's list

Parameters:
behavior the number of the behavior in this list.
Returns:
returns the name of the behavior specified

ArgListPtr green::EntityTemplate::GetBehaviorArgs ( size_t  behavior  )  const [inline]

Get the arguments for a behavior in the list.

Parameters:
behavior The behavior number of the behavior arguments you want.
Returns:
returns a const reference to the argument list in question.

size_t green::EntityTemplate::GetNumBehaviors (  )  const [inline]

Get the number of BehaviorTemplates in the list.

Returns:
Returns the number of BehaviorTemplates in the list

void green::EntityTemplate::addInitCode ( UnresOpSeqPtr  uInitCodeIn  )  [inline]

This adds the unresolved init code to this entity.

Parameters:
uBodyCodeIn the body code to add

UnresOpSeqPtr green::EntityTemplate::getInitCode (  )  [inline]

This gets the unresolved init code from this entity.

Returns:
the UnresOpCode if it exists, a null shared pointer otherwise.

void green::EntityTemplate::addResolvedInit ( VariableTableTemplatePtr  argList,
OpSeqPtr  resdCode 
) [inline]

This adds resolved init code. This adds resolved code (OpSeq). It also as a hack adds the argList from the other arg list.

Parameters:
argList the argument list in VariableTableTemplate format to set to InitFormat.
resdCode the OpSeq to set as code

virtual void green::EntityTemplate::Print ( std::ostream &  os  )  [inline, virtual]

A nice Print function to print the contents of the table. This version will also print behavior information.

Parameters:
os The output ostream to print to.

Reimplemented from green::VariableTableTemplate.


The documentation for this class was generated from the following file:
Generated on Fri Apr 27 10:27:39 2007 for Green Engine by  doxygen 1.5.1