|
Rehti MMORPG
1.0.0
Rehti MMORPG is a free and open source MMORPG game.
|
Represents an action that an entity can perform. More...
#include <Action.hpp>


Public Member Functions | |
| Action (std::chrono::system_clock::time_point startTime, std::shared_ptr< Entity > pEntity) | |
| ~Action ()=default | |
| std::chrono::system_clock::time_point | getStartTime () |
| Get the time when the action started. More... | |
| std::chrono::milliseconds | getActionTime () |
| Get the time how long a single iteration of the action takes. More... | |
| ActionType | getActionType () |
| Get the ActionType object. More... | |
| virtual CurrentAction | getActionInfo () |
| Returns information about the current action. This is used to send information to the client. More... | |
| bool | isCompleted () |
| Returns true if the action is completed. More... | |
| virtual void | act ()=0 |
| Functionality for the action, pure virtual function that needs to be implemented by derived classes. Gets called on every server tick. More... | |
Protected Attributes | |
| std::chrono::system_clock::time_point | startTimeM |
| std::chrono::milliseconds | actionTimeM = std::chrono::milliseconds(0) |
| ActionType | actionTypeM = ActionType::None |
| std::shared_ptr< Entity > | pEntityM |
| bool | completedM = false |
Represents an action that an entity can perform.
| Action::Action | ( | std::chrono::system_clock::time_point | startTime, |
| std::shared_ptr< Entity > | pEntity | ||
| ) |
|
default |
|
pure virtual |
Functionality for the action, pure virtual function that needs to be implemented by derived classes. Gets called on every server tick.
Implemented in RespawnAction, PickUpAction, ObjectInteractAction, MoveAction, and AttackAction.
|
virtual |
Returns information about the current action. This is used to send information to the client.
Reimplemented in RespawnAction, ObjectInteractAction, MoveAction, and AttackAction.
| std::chrono::milliseconds Action::getActionTime | ( | ) |
Get the time how long a single iteration of the action takes.
| ActionType Action::getActionType | ( | ) |
Get the ActionType object.
| std::chrono::system_clock::time_point Action::getStartTime | ( | ) |
Get the time when the action started.
| bool Action::isCompleted | ( | ) |
Returns true if the action is completed.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |