Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
RespawnAction.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Action.hpp"
4 
8 class RespawnAction : public Action
9 {
10 public:
11  RespawnAction(std::chrono::system_clock::time_point startTime, std::chrono::milliseconds respawnTime, std::shared_ptr<Entity> pEntity);
12 
13  ~RespawnAction() = default;
14 
19  void act();
20 
26  CurrentAction getActionInfo();
27 
28 private:
29  std::chrono::milliseconds actionTimeM;
30 
31  ActionType actionTypeM = ActionType::Respawn;
32 };
Represents an action that an entity can perform.
Definition: Action.hpp:15
Action used for respawning entities.
Definition: RespawnAction.hpp:9
RespawnAction(std::chrono::system_clock::time_point startTime, std::chrono::milliseconds respawnTime, std::shared_ptr< Entity > pEntity)
Definition: RespawnAction.cpp:7
std::chrono::milliseconds actionTimeM
Definition: RespawnAction.hpp:29
ActionType actionTypeM
Definition: RespawnAction.hpp:31
CurrentAction getActionInfo()
Returns information about the current action.
Definition: RespawnAction.cpp:25
~RespawnAction()=default
void act()
After time indicated by actionTimeM has passed, moves pEntity to its respawn location and changes hp ...
Definition: RespawnAction.cpp:9