mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-02 00:47:45 +00:00
Refactor -> removal of unnessecary player pointer in eventhandler
This commit is contained in:
parent
4eee04156d
commit
65bdba4dfe
4 changed files with 5 additions and 10 deletions
|
@ -13,7 +13,7 @@
|
||||||
namespace Sapphire::Entity
|
namespace Sapphire::Entity
|
||||||
{
|
{
|
||||||
|
|
||||||
using HateListEntry = struct
|
struct HateListEntry
|
||||||
{
|
{
|
||||||
uint32_t m_hateAmount;
|
uint32_t m_hateAmount;
|
||||||
CharaPtr m_pChara;
|
CharaPtr m_pChara;
|
||||||
|
|
|
@ -90,7 +90,7 @@ void Sapphire::Entity::Player::eventStart( uint64_t actorId, uint32_t eventId,
|
||||||
uint32_t eventParam2, Event::EventHandler::EventFinishCallback callback )
|
uint32_t eventParam2, Event::EventHandler::EventFinishCallback callback )
|
||||||
{
|
{
|
||||||
|
|
||||||
auto newEvent = Event::make_EventHandler( this, actorId, eventId, eventType, eventParam2 );
|
auto newEvent = Event::make_EventHandler( actorId, eventId, eventType, eventParam2 );
|
||||||
|
|
||||||
newEvent->setEventFinishCallback( callback );
|
newEvent->setEventFinishCallback( callback );
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
#include "EventHandler.h"
|
#include "EventHandler.h"
|
||||||
|
|
||||||
Sapphire::Event::EventHandler::EventHandler( Entity::Player* pOwner, uint64_t actorId, uint32_t eventId,
|
Sapphire::Event::EventHandler::EventHandler( uint64_t actorId, uint32_t eventId,
|
||||||
EventType eventType, uint32_t eventParam ) :
|
EventType eventType, uint32_t eventParam ) :
|
||||||
m_pOwner( pOwner ),
|
|
||||||
m_actorId( actorId ),
|
m_actorId( actorId ),
|
||||||
m_eventId( eventId ),
|
m_eventId( eventId ),
|
||||||
m_eventType( eventType ),
|
m_eventType( eventType ),
|
||||||
|
|
|
@ -79,8 +79,7 @@ namespace Sapphire::Event
|
||||||
using SceneChainCallback = std::function< void( Entity::Player& ) >;
|
using SceneChainCallback = std::function< void( Entity::Player& ) >;
|
||||||
using EventFinishCallback = std::function< void( Entity::Player&, uint64_t ) >;
|
using EventFinishCallback = std::function< void( Entity::Player&, uint64_t ) >;
|
||||||
|
|
||||||
EventHandler( Entity::Player* pOwner, uint64_t actorId, uint32_t eventId, EventType eventType,
|
EventHandler( uint64_t actorId, uint32_t eventId, EventType eventType, uint32_t eventParam );
|
||||||
uint32_t eventParam );
|
|
||||||
|
|
||||||
~EventHandler()
|
~EventHandler()
|
||||||
{
|
{
|
||||||
|
@ -118,10 +117,7 @@ namespace Sapphire::Event
|
||||||
|
|
||||||
void removeNestedEvent();
|
void removeNestedEvent();
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Entity::Player* m_pOwner;
|
|
||||||
|
|
||||||
uint64_t m_actorId;
|
uint64_t m_actorId;
|
||||||
uint32_t m_eventId;
|
uint32_t m_eventId;
|
||||||
uint16_t m_entryId;
|
uint16_t m_entryId;
|
||||||
|
|
Loading…
Add table
Reference in a new issue