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

62 lines
1.1 KiB
C
Raw Normal View History

2017-08-08 13:53:47 +02:00
#ifndef _ACTION_H_
#define _ACTION_H_
2018-03-06 22:22:19 +01:00
#include <Common.h>
#include "../Forwards.h"
2017-08-08 13:53:47 +02:00
namespace Core {
namespace Action {
2017-08-08 13:53:47 +02:00
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::CharaPtr getTargetChara() const;
2017-08-08 13:53:47 +02:00
bool isInterrupted() const;
void setInterrupted();
uint64_t getStartTime() const;
void setStartTime( uint64_t startTime );
uint32_t getCastTime() const;
void setCastTime( uint32_t castTime );
Entity::CharaPtr getActionSource() const;
2017-08-08 13:53:47 +02:00
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::CharaPtr m_pSource;
Entity::CharaPtr m_pTarget;
2017-08-08 13:53:47 +02:00
bool m_bInterrupt;
};
}
}
#endif