Actions used for interacting with objects.
More...
#include <ObjectInteractAction.hpp>
|
| | ObjectInteractAction (std::chrono::system_clock::time_point startTime, std::shared_ptr< Object > pTarget, std::shared_ptr< Entity > pEntity) |
| |
| | ~ObjectInteractAction ()=default |
| |
| void | act () |
| | Objecct interact functionality, which performs target object's interact functionality, and moves entity next to the object if not already. Implementation of pure virtual method act() of the base class. More...
|
| |
| CurrentAction | getActionInfo () |
| | Returns information about the current action. More...
|
| |
| | 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...
|
| |
Actions used for interacting with objects.
◆ ObjectInteractAction()
| ObjectInteractAction::ObjectInteractAction |
( |
std::chrono::system_clock::time_point |
startTime, |
|
|
std::shared_ptr< Object > |
pTarget, |
|
|
std::shared_ptr< Entity > |
pEntity |
|
) |
| |
◆ ~ObjectInteractAction()
| ObjectInteractAction::~ObjectInteractAction |
( |
| ) |
|
|
default |
◆ act()
| void ObjectInteractAction::act |
( |
| ) |
|
|
virtual |
Objecct interact functionality, which performs target object's interact functionality, and moves entity next to the object if not already. Implementation of pure virtual method act() of the base class.
Implements Action.
◆ getActionInfo()
| CurrentAction ObjectInteractAction::getActionInfo |
( |
| ) |
|
|
virtual |
Returns information about the current action.
- Returns
- CurrentAction
Reimplemented from Action.
◆ actionTimeM
| std::chrono::milliseconds ObjectInteractAction::actionTimeM = std::chrono::milliseconds(3000) |
|
private |
◆ actionTypeM
| const ActionType ObjectInteractAction::actionTypeM = ActionType::ObjectInteract |
|
private |
◆ moveTimeM
| std::chrono::milliseconds ObjectInteractAction::moveTimeM |
|
private |
◆ nextMoveM
| std::optional<Coordinates> ObjectInteractAction::nextMoveM |
|
private |
◆ pathToTargetM
| std::vector<std::pair<int, int> > ObjectInteractAction::pathToTargetM |
|
private |
◆ pTargetM
| std::shared_ptr<Object> ObjectInteractAction::pTargetM |
|
private |
◆ targetInRangeM
| bool ObjectInteractAction::targetInRangeM = true |
|
private |
True if the target is in range.
The documentation for this class was generated from the following files: