Radium Engine  1.5.20
Loading...
Searching...
No Matches
SignalManager.cpp
1#include <Engine/Scene/SignalManager.hpp>
2
3namespace Ra {
4namespace Engine {
5namespace Scene {
6
10
11SignalManager::ItemObservable& SignalManager::getEntityDestroyedNotifier() {
12 return m_entityDestroyedCallbacks;
13}
14
15SignalManager::ItemObservable& SignalManager::getComponentCreatedNotifier() {
16 return m_componentAddedCallbacks;
17}
18
19SignalManager::ItemObservable& SignalManager::getComponentDestroyedNotifier() {
20 return m_componentRemovedCallbacks;
21}
22
23SignalManager::ItemObservable& SignalManager::getRenderObjectCreatedNotifier() {
24 return m_roAddedCallbacks;
25}
26
27SignalManager::ItemObservable& SignalManager::getRenderObjectDestroyedNotifier() {
28 return m_roRemovedCallbacks;
29}
30
31SignalManager::FrameObservable& SignalManager::getEndFrameNotifier() {
32 return m_frameEndCallbacks;
33}
34
35void SignalManager::fireEntityCreated( const ItemEntry& entity ) const {
36 CORE_ASSERT( entity.isEntityNode(), "Invalid entry" );
37 notify<const ItemEntry&>( m_entityCreatedCallbacks, entity );
38}
39
40void SignalManager::fireEntityDestroyed( const ItemEntry& entity ) const {
41 CORE_ASSERT( entity.isEntityNode(), "Invalid entry" );
42 notify<const ItemEntry&>( m_entityDestroyedCallbacks, entity );
43}
44
45void SignalManager::fireComponentAdded( const ItemEntry& component ) const {
46 CORE_ASSERT( component.isComponentNode(), "Invalid entry" );
47 notify<const ItemEntry&>( m_componentAddedCallbacks, component );
48}
49
50void SignalManager::fireComponentRemoved( const ItemEntry& component ) const {
51 CORE_ASSERT( component.isComponentNode(), "Invalid entry" );
52 notify<const ItemEntry&>( m_componentRemovedCallbacks, component );
53}
54
56 CORE_ASSERT( ro.isRoNode(), "Invalid entry" );
57 notify<const ItemEntry&>( m_roAddedCallbacks, ro );
58}
60 CORE_ASSERT( ro.isRoNode(), "Invalid entry" );
61 notify<const ItemEntry&>( m_roRemovedCallbacks, ro );
62}
63
65 notify<>( m_frameEndCallbacks );
66}
67
68} // namespace Scene
69} // namespace Engine
70} // namespace Ra
void fireEntityDestroyed(const ItemEntry &entity) const
Notifies all observers of an entity removal.
ItemObservable & getEntityCreatedNotifier()
void fireRenderObjectRemoved(const ItemEntry &ro) const
Notifies all observers of a render object removal.
Ra::Core::Utils::Observable<> FrameObservable
Type for frame observable.
void fireComponentAdded(const ItemEntry &component) const
Notifies all observers of a component creation.
void fireEntityCreated(const ItemEntry &entity) const
Notifies all observers of an entity creation.
void fireComponentRemoved(const ItemEntry &component) const
Notifies all observers of a component removal.
void fireRenderObjectAdded(const ItemEntry &ro) const
Notifies all observers of a render object creation.
void fireFrameEnded() const
Notifies all observers of a end of frame event.
Ra::Core::Utils::Observable< const ItemEntry & > ItemObservable
Type for item (entity, component or render object) observable.
hepler function to manage enum as underlying types in VariableSet
Definition Cage.cpp:3
bool isComponentNode() const
Returns true if the item represents a component.
Definition ItemEntry.hpp:85
bool isEntityNode() const
Returns true if the item represents an entity.
Definition ItemEntry.hpp:80
bool isRoNode() const
Returns true if the item represents a render object.
Definition ItemEntry.hpp:90