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

71 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 "ForwardsZone.h"
2017-08-08 13:53:47 +02:00
namespace Sapphire::Action
{
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
class Action
{
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
public:
Action();
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
virtual ~Action();
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
uint16_t getId() const;
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
Common::HandleActionType getHandleActionType() const;
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
Entity::CharaPtr getTargetChara() const;
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
bool isInterrupted() const;
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
void setInterrupted();
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
uint64_t getStartTime() const;
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
void setStartTime( uint64_t startTime );
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
uint32_t getCastTime() const;
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
void setCastTime( uint32_t castTime );
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
Entity::CharaPtr getActionSource() const;
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
virtual void onStart()
{
};
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
virtual void onFinish()
{
};
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
virtual void onInterrupt()
{
};
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
// update action, if returns true, action is done and has to be removed from the actor
virtual bool update();
2017-08-08 13:53:47 +02:00
2018-10-28 21:53:21 +01:00
protected:
uint16_t m_id;
Common::HandleActionType m_handleActionType;
2018-10-28 21:53:21 +01:00
uint64_t m_startTime;
uint32_t m_castTime;
2018-10-28 21:53:21 +01:00
Entity::CharaPtr m_pSource;
Entity::CharaPtr m_pTarget;
2018-10-28 21:53:21 +01:00
bool m_bInterrupt;
2017-08-08 13:53:47 +02:00
FrameworkPtr m_pFw;
2018-10-28 21:53:21 +01:00
};
2017-08-08 13:53:47 +02:00
}
#endif