1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-30 16:17:46 +00:00
sapphire/src/world/Event/EventHandler.cpp

66 lines
1.3 KiB
C++
Raw Normal View History

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-01-09 23:50:54 +01:00
Core::Event::EventHandler::SceneReturnCallback Core::Event::EventHandler::getEventReturnCallback() const
{
2018-01-09 23:50:54 +01:00
return m_callback;
}
2018-01-09 23:50:54 +01:00
void Core::Event::EventHandler::setEventReturnCallback( SceneReturnCallback callback )
{
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-01-09 23:50:54 +01:00
return m_playedScene;
}
2018-01-09 23:50:54 +01:00
void Core::Event::EventHandler::setPlayedScene( bool playedScene )
{
2018-01-09 23:50:54 +01:00
m_playedScene = playedScene;
}