5 #include "../world/Coordinates.hpp"
15 AttackAction(std::chrono::system_clock::time_point startTime, std::shared_ptr<Entity> pTarget, std::shared_ptr<Entity> pEntity);
Represents an action that an entity can perform.
Definition: Action.hpp:15
Action used for attacks.
Definition: AttackAction.hpp:13
bool targetInRangeM
True if the target is in range.
Definition: AttackAction.hpp:57
ActionType actionTypeM
Definition: AttackAction.hpp:53
std::optional< Coordinates > nextMoveM
The next move to be taken, is defined if the target is not in range.
Definition: AttackAction.hpp:56
std::vector< std::pair< int, int > > pathToTargetM
Path to the target.
Definition: AttackAction.hpp:55
std::shared_ptr< Entity > pTargetM
Definition: AttackAction.hpp:47
std::shared_ptr< Entity > & getTarget()
Get the target Entity of the action.
Definition: AttackAction.cpp:11
AttackAction(std::chrono::system_clock::time_point startTime, std::shared_ptr< Entity > pTarget, std::shared_ptr< Entity > pEntity)
Definition: AttackAction.cpp:7
std::chrono::milliseconds moveTimeM
Definition: AttackAction.hpp:51
std::chrono::milliseconds actionTimeM
Definition: AttackAction.hpp:49
std::vector< std::pair< int, int > > findPathToTarget()
Finds a path to the target.
Definition: AttackAction.cpp:75
void act()
Attack functionality, which performs attacks against target and moves closer to the target if not in ...
Definition: AttackAction.cpp:16
CurrentAction getActionInfo()
Returns information about the current action.
Definition: AttackAction.cpp:84