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>
|
2018-09-24 23:48:42 +02:00
|
|
|
#include "ForwardsZone.h"
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-11-29 16:55:48 +01:00
|
|
|
namespace Sapphire::Action
|
2018-08-29 21:40:59 +02:00
|
|
|
{
|
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-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
uint64_t m_startTime;
|
|
|
|
uint32_t m_castTime;
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
Entity::CharaPtr m_pSource;
|
|
|
|
Entity::CharaPtr m_pTarget;
|
2018-08-29 21:40:59 +02:00
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
bool m_bInterrupt;
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-12-29 00:53:52 +01:00
|
|
|
FrameworkPtr m_pFw;
|
|
|
|
|
2018-10-28 21:53:21 +01:00
|
|
|
};
|
2017-08-08 13:53:47 +02:00
|
|
|
}
|
|
|
|
|
2017-12-08 15:38:25 +01:00
|
|
|
#endif
|