71 LOG_W(
"Could not add new invokable " + newInvokable.
GetName() +
" for " +
GetName() +
" because an invokable with that name already exists.")
97 LOG_W(
"Could not remove invokable " + invokableName +
" because an invokable with that name does not exists.")
112 return itor->second.Get();
125 toFill.push_back(i->second.Get());
138 toFill.push_back(i->second.Get());
171 for (
unsigned int i = 0; i <
mChildren.size(); ++i)
191 for (
int i =
mChildren.size() - 1; i >= 0; --i)
217 for (
unsigned int i = 0; i <
mChildren.size(); ++i)
300 LOG_W(
"The Entity " +
GetName() +
" was not attached to a parent.")
309 for (
unsigned int i = 0; i <
mChildren.size(); ++i)
331 LOG_E(
GetName() +
" is not attached to a parent. Can't remove it from Hierarchy.")
static const trUtil::RefStr CLASS_TYPE
Adds an easy and swappable access to the base class.
void GetInvokables(std::vector< trManager::Invokable *> &toFill)
Gets the list of invokables.
static const EntityType INVALID
virtual const trManager::EntityBase * FindChild(const trBase::UniqueId &childId)
Finds a child of this Entity in the children list.
virtual const std::string & GetName()
Returns this instances name.
static const trUtil::RefStr ON_TICK_REMOTE_INVOKABLE
Invokable for Tick messages.
This class creates a GUID, or a Unique ID that is used through out TR to identify and distinguish one...
virtual void SetSystemManager(trManager::SystemManager *sysMan)
This method is used by the System Manager to pass the Entity an instance if itself when it is registe...
Smart pointer for handling referenced counted objects.
const std::string & GetName() const
const std::string & GetName() const
Inlined because it's called frequently.
virtual std::vector< trBase::SmrtPtr< trManager::EntityBase > > * GetChildren()
An Invokable is a queriable method interface that can be added to a trManager::ActorBase Invoking the...
A string wrapper that will make sure that all of the strings with the same value will point to the sa...
virtual void Emancipate()
Removes the hierarchal parent of this Entity, and removes this Entity from the parent.
A class that specifies what kind of entity an object is in the Entity System.
virtual void OnParentRemoved(trManager::EntityBase &parent)
Convenience function that will be called by the system when the Entities parent is removed...
EntityBase(const std::string &name=CLASS_TYPE)
Invokable for Tick Remote messages.
trUtil::EnumerationPointer< const trManager::EntityType > mEntityType
System Manager class is a singleton that is responsible for all message routing and basic operations ...
static const trUtil::RefStr ON_TICK_INVOKABLE
Invokable for general messages.
#define LOG_W(msg)
Log a WARNING message.
This class is part of the internal garbage collection system.
static const EntityType ACTOR
virtual void AddInvokable(trManager::Invokable &newInvokable)
Adds an invokable that can receive a message.
static const trUtil::RefStr ON_MESSAGE_INVOKABLE
Holds the class type name for efficient comparisons.
trBase::ObsrvrPtr< trManager::SystemManager > mSysMan
virtual void RemoveInvokable(trManager::Invokable *invokable)
Removes the invokable that is passed in.
virtual void ForgetParent()
Forgets the hierarchal parent of this Entiry.
#define LOG_E(msg)
Log an ERROR message.
trManager::Invokable * GetInvokable(const std::string &name)
Gets a registered invokable.
bool Valid() const
Returns True if the smart pointer has a valid internal pointer set.
virtual const trBase::UniqueId & GetUUID(void)
Returns the instances Universally Unique ID.
virtual const bool & IsRegistered()
Returns True if the Instance is registered with a System Manager.
virtual bool AddChild(trManager::EntityBase &child)
Adds a child to this Entity.
virtual bool RemoveFromHierarchy()
Removes from this entity from the hierarchy tree attaching its children to its parent.
trBase::SmrtPtr< trManager::EntityBase > mParent
virtual bool RemoveAllChildren()
Removes all of the entities children .
trUtil::HashMap< std::string, trBase::SmrtPtr< trManager::Invokable > > mInvokables
T * Get() const
Returns the stored internal pointer.
std::vector< trBase::SmrtPtr< trManager::EntityBase > > mChildren
const EntityType & GetEntityType()
Returns the Entity Type, which is usually a Director, Actor, or an Actor module.
This serves as the base class for the Entity class and removes a circular dependency between Entity a...
virtual void SetRegistration(bool isRegistered)
Is set to True by the System Manager when the class instance is registered with it.
virtual int GetNumOfChildren()
Gets the children of this Entity has.
virtual bool RemoveChild(trManager::EntityBase &child)
Removes the child from this Entity.
trManager::EntityBase * GetParent()
Gets the parent of this hierarchal Entity.
#define LOG_D(msg)
Log a DEBUG message.
virtual void SetParent(trManager::EntityBase &parent)
Sets the hierarchal parent of this Entity.
virtual void OnParentSet(trManager::EntityBase &parent)
Convenience function that will be called by the system when a new parent is added or set to the Entit...