2018-01-09 23:50:54 +01:00
|
|
|
#include "EventHandler.h"
|
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
Core::Event::EventHandler::EventHandler( uint64_t actorId, uint32_t eventId, EventType eventType, uint32_t eventParam3 ) :
|
|
|
|
m_actorId( actorId ),
|
|
|
|
m_eventId( eventId ),
|
|
|
|
m_eventType( eventType ),
|
|
|
|
m_playedScene( false )
|
2018-01-09 23:50:54 +01:00
|
|
|
{
|
2018-01-09 23:50:54 +01:00
|
|
|
m_entryId = static_cast< uint16_t >( eventId );
|
|
|
|
m_type = static_cast< uint16_t >( eventId >> 16 );
|
2018-01-09 23:50:54 +01:00
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
m_eventParam3 = eventParam3;
|
2018-01-09 23:50:54 +01:00
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
m_callback = nullptr;
|
2018-01-09 23:50:54 +01:00
|
|
|
}
|
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
uint64_t Core::Event::EventHandler::getActorId() const
|
2018-01-09 23:50:54 +01:00
|
|
|
{
|
2018-01-09 23:50:54 +01:00
|
|
|
return m_actorId;
|
2018-01-09 23:50:54 +01:00
|
|
|
}
|
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
uint32_t Core::Event::EventHandler::getId() const
|
2018-01-09 23:50:54 +01:00
|
|
|
{
|
2018-01-09 23:50:54 +01:00
|
|
|
return m_eventId;
|
2018-01-09 23:50:54 +01:00
|
|
|
}
|
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
uint8_t Core::Event::EventHandler::getEventType() const
|
2018-01-09 23:50:54 +01:00
|
|
|
{
|
2018-01-09 23:50:54 +01:00
|
|
|
return m_eventType;
|
2018-01-09 23:50:54 +01:00
|
|
|
}
|
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
uint16_t Core::Event::EventHandler::getType() const
|
2018-01-09 23:50:54 +01:00
|
|
|
{
|
2018-01-09 23:50:54 +01:00
|
|
|
return m_type;
|
2018-01-09 23:50:54 +01:00
|
|
|
}
|
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
uint16_t Core::Event::EventHandler::getEntryId() const
|
2018-01-09 23:50:54 +01:00
|
|
|
{
|
2018-01-09 23:50:54 +01:00
|
|
|
return m_entryId;
|
2018-01-09 23:50:54 +01:00
|
|
|
}
|
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
uint32_t Core::Event::EventHandler::getEventParam3() const
|
2018-01-09 23:50:54 +01:00
|
|
|
{
|
2018-01-09 23:50:54 +01:00
|
|
|
return m_eventParam3;
|
2018-03-20 22:08:25 +11:00
|
|
|
}
|
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
Core::Event::EventHandler::SceneReturnCallback Core::Event::EventHandler::getEventReturnCallback() const
|
2018-03-20 22:08:25 +11:00
|
|
|
{
|
2018-01-09 23:50:54 +01:00
|
|
|
return m_callback;
|
2018-03-20 22:08:25 +11:00
|
|
|
}
|
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
void Core::Event::EventHandler::setEventReturnCallback( SceneReturnCallback callback )
|
2018-03-20 22:08:25 +11:00
|
|
|
{
|
2018-01-09 23:50:54 +01:00
|
|
|
m_callback = callback;
|
2018-01-09 23:50:54 +01:00
|
|
|
}
|
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
bool Core::Event::EventHandler::hasPlayedScene() const
|
2018-11-19 23:52:35 +01:00
|
|
|
{
|
2018-01-09 23:50:54 +01:00
|
|
|
return m_playedScene;
|
2018-11-19 23:52:35 +01:00
|
|
|
}
|
|
|
|
|
2018-01-09 23:50:54 +01:00
|
|
|
void Core::Event::EventHandler::setPlayedScene( bool playedScene )
|
2018-11-19 23:52:35 +01:00
|
|
|
{
|
2018-01-09 23:50:54 +01:00
|
|
|
m_playedScene = playedScene;
|
2018-11-19 23:52:35 +01:00
|
|
|
}
|