61 mSysMan->RegisterForMessage(messageType, *
this, invokableName);
65 LOG_E(
"The entity " +
GetName() +
" is missing the internal System Manager reference. ")
68 LOG_W(
"The entity " +
GetName() +
" is not registered with System Manager. ")
78 mSysMan->UnregisterFromMessage(messageType, *
this);
82 LOG_E(
"The entity " +
GetName() +
" is missing the internal System Manager reference. ")
85 LOG_W(
"The entity " +
GetName() +
" is not registered with System Manager. ")
95 mSysMan->RegisterForMessagesAboutEntity(*
this, aboutEntityId, invokableName);
99 LOG_E(
"The entity " +
GetName() +
" is missing the internal System Manager reference. ")
102 LOG_W(
"The entity " +
GetName() +
" is not registered with System Manager. ")
112 mSysMan->UnregisterFromMessagesAboutEntity(*
this, aboutEntityId);
116 LOG_E(
"The entity " +
GetName() +
" is missing the internal System Manager reference. ")
119 LOG_W(
"The entity " +
GetName() +
" is not registered with System Manager. ")
140 return mSysMan->SendMessage(message);
144 LOG_E(
"The entity " +
GetName() +
" is missing the internal System Manager reference. ")
147 LOG_W(
"The entity " +
GetName() +
" is not registered with System Manager. ")
159 return mSysMan->SendNetworkMessage(message);
163 LOG_E(
"The entity " +
GetName() +
" is missing the internal System Manager reference. ")
166 LOG_W(
"The entity " +
GetName() +
" is not registered with System Manager. ")
201 ActorModules::iterator found;
204 if (found->Get() == &actorModule)
207 found->Get()->ForgetParent();
217 LOG_E(
"Attempted to remove a module which does not exist")
233 if (foundModule !=
nullptr)
246 for (
int index =
mActorModules.size() - 1; index >= 0; --index)
263 ActorModules::iterator found;
266 if (found->Get()->GetUUID() == id)
299 for (
unsigned int index = 0; index <
mActorModules.size(); ++index)
virtual void UnregisterFromMessagesAboutEntity(const trBase::UniqueId &aboutEntityId)
Unregisters from messages about a specific actor.
virtual void OnTick(const trManager::MessageBase &msg)=0
Convenience function that will receive Tick Messages from the System Manager This does not happen aut...
virtual const std::string & GetName()
Returns this instances name.
static const trUtil::RefStr ON_TICK_REMOTE_INVOKABLE
Invokable for Tick messages.
virtual bool SendNetworkMessage(const trManager::MessageBase &message)
Send a Network message to an Actor, Actor Module, or a Director.
This class creates a GUID, or a Unique ID that is used through out TR to identify and distinguish one...
virtual bool RemoveActorModule(trManager::EntityBase &actorModule)
Removes the given Actor Module from the current Actor.
const std::string & GetName() const
Inlined because it's called frequently.
static const EntityType ACTOR_MODULE
virtual void RegisterForMessagesAboutEntity(const trBase::UniqueId &aboutEntityId, const std::string &invokableName)
Registers for messages about a specific actor.
virtual void OnRemovedFromSysMan()
Called by the System Manager after removing and Unregistering the EntityBase.
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...
trUtil::EnumerationPointer< const trManager::EntityType > mEntityType
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
Functor< typename trUtil::FunTraits< CallType >::ResultType, typename trUtil::FunTraits< CallType >::TypeListType > MakeFunctor(CallType fun)
Constructor.
virtual void AddInvokable(trManager::Invokable &newInvokable)
Adds an invokable that can receive a message.
virtual void RegisterForMessage(const std::string &messageType, const std::string &invokableName)
Registers an actor for messages.
trBase::ObsrvrPtr< trManager::SystemManager > mSysMan
ActorModules mActModReAttachStore
virtual trManager::EntityBase * FindActorModule(const trBase::UniqueId &id)
Finds and returns the Actor Module cast down to Entity.
virtual void OnAddedToSysMan() override
Called by the System Manager when EntityBase Registration is complete.
virtual void OnRemovedFromSysMan() override
Called by the System Manager after removing and Unregistering the EntityBase.
#define LOG_E(msg)
Log an ERROR message.
virtual const bool & IsRegistered()
Returns True if the Instance is registered with a System Manager.
virtual void UnRegisterFromMessage(const std::string &messageType)
Unregister an actor that is listening for a given message.
virtual bool AddActorModule(trManager::EntityBase &actorModule)
Adds an Actor Module to the current Actor.
virtual bool RemoveAllActorModules()
virtual void OnTickRemote(const trManager::MessageBase &msg)
Convenience function that will receive a Network Tick Message from the System Manager This does not h...
static const trUtil::RefStr CLASS_TYPE
Adds an easy and swappable access to the base class.
const EntityType & GetEntityType()
Returns the Entity Type, which is usually a Director, Actor, or an Actor module.
virtual void BuildInvokables()
Builds the default invokables for this class.
This serves as the base class for the Entity class and removes a circular dependency between Entity a...
virtual void ActorModuleTick(const trManager::MessageBase &tickMsg)
Sends the passed in message Tick Message to all attached Actor Modules.
ActorBase(const std::string &name=CLASS_TYPE)
Holds the class type name for efficient comparisons.
This is the base class for all the messages in TR.
virtual bool SendMessage(const trManager::MessageBase &message)
Send a message to an Actor, Actor Module, or a Director.
ActorModules mActorModules
virtual void SetParent(trManager::EntityBase &parent)
Sets the hierarchal parent of this Entity.
virtual void OnAddedToSysMan()
Called by the System Manager when EntityBase Registration is complete.