1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 14:37:44 +00:00
sapphire/src/servers/Server_Zone/Action/Action.h

60 lines
1.1 KiB
C
Raw Normal View History

2017-08-08 13:53:47 +02:00
#ifndef _ACTION_H_
#define _ACTION_H_
2017-08-19 00:18:40 +02:00
#include <src/servers/Server_Common/Common.h>
#include "src/servers/Server_Zone/Forwards.h"
2017-08-08 13:53:47 +02:00
namespace Core { namespace Action {
class Action
{
public:
Action();
virtual ~Action();
2017-11-28 17:43:00 +01:00
uint16_t getId() const;
2017-08-08 13:53:47 +02:00
2017-09-05 00:37:22 -03:00
Common::HandleActionType getHandleActionType() const;
2017-08-08 13:53:47 +02:00
Entity::ActorPtr getTargetActor() const;
bool isInterrupted() const;
void setInterrupted();
uint64_t getStartTime() const;
void setStartTime( uint64_t startTime );
uint32_t getCastTime() const;
void setCastTime( uint32_t castTime );
Entity::ActorPtr getActionSource() const;
virtual void onStart() {};
virtual void onFinish() {};
virtual void onInterrupt() {};
// update action, if returns true, action is done and has to be removed from the actor
virtual bool update();
protected:
2017-11-28 17:43:00 +01:00
uint16_t m_id;
2017-09-05 00:37:22 -03:00
Common::HandleActionType m_handleActionType;
2017-08-08 13:53:47 +02:00
uint64_t m_startTime;
uint32_t m_castTime;
Entity::ActorPtr m_pSource;
Entity::ActorPtr m_pTarget;
bool m_bInterrupt;
};
}
}
#endif