Rehti MMORPG  1.0.0
Rehti MMORPG is a free and open source MMORPG game.
RespawnAction Class Reference

Action used for respawning entities. More...

#include <RespawnAction.hpp>

Inheritance diagram for RespawnAction:
Inheritance graph
Collaboration diagram for RespawnAction:
Collaboration graph

Public Member Functions

 RespawnAction (std::chrono::system_clock::time_point startTime, std::chrono::milliseconds respawnTime, std::shared_ptr< Entity > pEntity)
 
 ~RespawnAction ()=default
 
void act ()
 After time indicated by actionTimeM has passed, moves pEntity to its respawn location and changes hp back to maximum. Implementation of pure virtual method act() of the base class. More...
 
CurrentAction getActionInfo ()
 Returns information about the current action. More...
 
- Public Member Functions inherited from Action
 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...
 
bool isCompleted ()
 Returns true if the action is completed. More...
 

Private Attributes

std::chrono::milliseconds actionTimeM
 
ActionType actionTypeM = ActionType::Respawn
 

Additional Inherited Members

- Protected Attributes inherited from Action
std::chrono::system_clock::time_point startTimeM
 
std::chrono::milliseconds actionTimeM = std::chrono::milliseconds(0)
 
ActionType actionTypeM = ActionType::None
 
std::shared_ptr< EntitypEntityM
 
bool completedM = false
 

Detailed Description

Action used for respawning entities.

Constructor & Destructor Documentation

◆ RespawnAction()

RespawnAction::RespawnAction ( std::chrono::system_clock::time_point  startTime,
std::chrono::milliseconds  respawnTime,
std::shared_ptr< Entity pEntity 
)

◆ ~RespawnAction()

RespawnAction::~RespawnAction ( )
default

Member Function Documentation

◆ act()

void RespawnAction::act ( )
virtual

After time indicated by actionTimeM has passed, moves pEntity to its respawn location and changes hp back to maximum. Implementation of pure virtual method act() of the base class.

Implements Action.

◆ getActionInfo()

CurrentAction RespawnAction::getActionInfo ( )
virtual

Returns information about the current action.

Returns
CurrentAction

Reimplemented from Action.

Member Data Documentation

◆ actionTimeM

std::chrono::milliseconds RespawnAction::actionTimeM
private

◆ actionTypeM

ActionType RespawnAction::actionTypeM = ActionType::Respawn
private

The documentation for this class was generated from the following files: