Action used for attacks.
More...
#include <AttackAction.hpp>
◆ AttackAction()
| AttackAction::AttackAction |
( |
std::chrono::system_clock::time_point |
startTime, |
|
|
std::shared_ptr< Entity > |
pTarget, |
|
|
std::shared_ptr< Entity > |
pEntity |
|
) |
| |
◆ ~AttackAction()
| AttackAction::~AttackAction |
( |
| ) |
|
|
default |
◆ act()
| void AttackAction::act |
( |
| ) |
|
|
virtual |
Attack functionality, which performs attacks against target and moves closer to the target if not in range. Implementation of pure virtual method act() of the base class.
Implements Action.
◆ findPathToTarget()
| std::vector< std::pair< int, int > > AttackAction::findPathToTarget |
( |
| ) |
|
|
private |
Finds a path to the target.
- Returns
- List of x,y pairs. Empty if no path is found
◆ getActionInfo()
| CurrentAction AttackAction::getActionInfo |
( |
| ) |
|
|
virtual |
Returns information about the current action.
- Returns
- CurrentAction
Reimplemented from Action.
◆ getTarget()
| std::shared_ptr< Entity > & AttackAction::getTarget |
( |
| ) |
|
Get the target Entity of the action.
- Returns
- std::shared_ptr<Entity>
◆ actionTimeM
| std::chrono::milliseconds AttackAction::actionTimeM |
|
private |
◆ actionTypeM
| ActionType AttackAction::actionTypeM = ActionType::Attack |
|
private |
◆ moveTimeM
| std::chrono::milliseconds AttackAction::moveTimeM |
|
private |
◆ nextMoveM
The next move to be taken, is defined if the target is not in range.
◆ pathToTargetM
| std::vector<std::pair<int, int> > AttackAction::pathToTargetM |
|
private |
◆ pTargetM
| std::shared_ptr<Entity> AttackAction::pTargetM |
|
private |
◆ targetInRangeM
| bool AttackAction::targetInRangeM = false |
|
private |
True if the target is in range.
The documentation for this class was generated from the following files: