1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-26 22:37:45 +00:00
sapphire/src/servers/sapphire_zone/Action/Action.h
2018-09-24 23:48:42 +02:00

70 lines
1,013 B
C++

#ifndef _ACTION_H_
#define _ACTION_H_
#include <Common.h>
#include "ForwardsZone.h"
namespace Core {
namespace Action {
class Action
{
public:
Action();
virtual ~Action();
uint16_t getId() const;
Common::HandleActionType getHandleActionType() const;
Entity::CharaPtr getTargetChara() 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::CharaPtr 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:
uint16_t m_id;
Common::HandleActionType m_handleActionType;
uint64_t m_startTime;
uint32_t m_castTime;
Entity::CharaPtr m_pSource;
Entity::CharaPtr m_pTarget;
bool m_bInterrupt;
};
}
}
#endif