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>
|
2017-12-08 15:38:25 +01:00
|
|
|
#include "../Forwards.h"
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-12-18 12:36:52 +01: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
|
|
|
|
2018-02-20 22:46:44 +01: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 );
|
|
|
|
|
2018-02-20 22:46:44 +01:00
|
|
|
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;
|
|
|
|
|
2018-02-20 22:46:44 +01:00
|
|
|
Entity::CharaPtr m_pSource;
|
|
|
|
Entity::CharaPtr m_pTarget;
|
2017-08-08 13:53:47 +02:00
|
|
|
|
|
|
|
bool m_bInterrupt;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-12-08 15:38:25 +01:00
|
|
|
#endif
|