Emergency 20 Dokumentation  4.2.0
ObserverHelper-inl.h
Go to the documentation of this file.
1 // Copyright (C) 2012-2018 Promotion Software GmbH
2 
3 
4 //[-------------------------------------------------------]
5 //[ Namespace ]
6 //[-------------------------------------------------------]
7 namespace em5
8 {
9 
10 
11  //[-------------------------------------------------------]
12  //[ Public methods ]
13  //[-------------------------------------------------------]
14  template<typename T>
16  {
17  return static_cast<T&>(mEvent.createObserverByTypeId(T::GAMELOGIC_TYPE_ID, entityId));
18  }
19 
20  template<typename T>
22  {
23  return static_cast<T&>(mEvent.createGeneralObserverByTypeId(T::GAMELOGIC_TYPE_ID));
24  }
25 
26 
27 //[-------------------------------------------------------]
28 //[ Namespace ]
29 //[-------------------------------------------------------]
30 } // em5
T & createObserver(uint64 entityId) const
Create and insert a new observer associated with a given entity ID.
Definition: ObserverHelper-inl.h:15
Definition: ActionPriority.h:13
Observer & createGeneralObserverByTypeId(uint32 typeId, const std::string &name=std::string())
Create a new general observer (i.e. not bound to a single entity, but observing the whole map) of the...
Definition: FreeplayEvent-inl.h:210
uint64_t uint64
Definition: PlatformTypes.h:184
Observer & createObserverByTypeId(uint32 typeId, uint64 entityId, const std::string &name=std::string())
Create a new observer of the specified type ID, inside the given entity.
T & createGeneralObserver() const
Create and insert a new observer associated to the core entity.
Definition: ObserverHelper-inl.h:21