Brunot
Loading...
Searching...
No Matches
MoveEntityAction Class Reference

An action that moves an Entity based on its current position. More...

#include <MoveEntityAction.h>

Inheritance diagram for MoveEntityAction:
[legend]
Collaboration diagram for MoveEntityAction:
[legend]

Public Member Functions

 MoveEntityAction ()=default
 MoveEntityAction (const MoveEntityAction &)=default
auto operator= (const MoveEntityAction &) -> MoveEntityAction &=default
 ~MoveEntityAction () override=default
 MoveEntityAction (MoveEntityAction &&other) noexcept=default
auto operator= (MoveEntityAction &&other) noexcept -> MoveEntityAction &=default
 MoveEntityAction (Point2D howMuchToMoveBy)
 MoveEntityAction (Point2D howMuchToMoveBy, float duration)
 MoveEntityAction (Point2D howMuchToMoveBy, float duration, const th::Bezier &easingFunction, float initialDelay, float endingDelay)
auto init () -> void override
 Virtual function that is called once, when the Action is first starting up.
auto execute () -> void override
 Virtual function that is called every frame to change a game object.
auto end () -> void override
 Virtual function that is called once, when an Action is finished executing.
auto ActionShowMenu () -> void override
 Displays a window in imgui.
auto render () const -> void override
 Function used to draw things to screen, useful for things such as debug drawing.
Public Member Functions inherited from Action
 Action ()=default
 Action (const Action &)=default
auto operator= (const Action &) -> Action &=default
virtual ~Action ()=default
 Action (Action &&other) noexcept=default
auto operator= (Action &&other) noexcept -> Action &=default
auto operator== (const Action &other) const -> bool
 Action (std::string name)
 Action (std::string name, float duration)
 Action (std::string name, float duration, const th::Bezier &bezierCurve, float initialDelay, float endingDelay)
auto update (float dt) -> void
 Universal update function that handles calling init, update, and end at the right time.
auto shouldRemove () const -> bool
auto getOwner () const -> Entity *
auto setOwner (Entity *newObject) -> void
auto getHasInitialized () const -> bool
auto getHasExecuted () const -> bool
auto getHasEnded () const -> bool
auto isPaused () const -> bool
auto setPaused (bool newState) -> void
auto isBlocking () const -> bool
auto setBlocking (bool newState) -> void
auto setInitialDelay (float delay) -> void
auto setEndingDelay (float delay) -> void
auto getName () -> std::string
 Function used for displaying info about what an Action does.
auto getCompletionPercentage () const -> float
 Function used to see how much the action has completed.

Private Attributes

TransformobjectTransform = nullptr
Point2D startingPosition
Point2D endingPosition

Additional Inherited Members

Protected Member Functions inherited from Action
auto percentageComplete () const -> float
template<typename T>
auto lerpBasedOnTime (const T &start, const T &end) -> T
Protected Attributes inherited from Action
EntitychangingObject = nullptr
std::string actionName = "BaseAction"

Detailed Description

An action that moves an Entity based on its current position.

@MoveEntityAction.h

Constructor & Destructor Documentation

◆ MoveEntityAction() [1/6]

MoveEntityAction::MoveEntityAction ( )
default
Here is the caller graph for this function:

◆ MoveEntityAction() [2/6]

MoveEntityAction::MoveEntityAction ( const MoveEntityAction & )
default
Here is the call graph for this function:

◆ ~MoveEntityAction()

MoveEntityAction::~MoveEntityAction ( )
overridedefault

◆ MoveEntityAction() [3/6]

MoveEntityAction::MoveEntityAction ( MoveEntityAction && other)
defaultnoexcept
Here is the call graph for this function:

◆ MoveEntityAction() [4/6]

MoveEntityAction::MoveEntityAction ( Point2D howMuchToMoveBy)
Here is the call graph for this function:

◆ MoveEntityAction() [5/6]

MoveEntityAction::MoveEntityAction ( Point2D howMuchToMoveBy,
float duration )
Here is the call graph for this function:

◆ MoveEntityAction() [6/6]

MoveEntityAction::MoveEntityAction ( Point2D howMuchToMoveBy,
float duration,
const th::Bezier & easingFunction,
float initialDelay,
float endingDelay )
Here is the call graph for this function:

Member Function Documentation

◆ ActionShowMenu()

void MoveEntityAction::ActionShowMenu ( ) ->void
overridevirtual

Displays a window in imgui.

Reimplemented from Action.

Here is the call graph for this function:

◆ end()

auto MoveEntityAction::end ( ) ->void
overridevirtual

Virtual function that is called once, when an Action is finished executing.

Reimplemented from Action.

◆ execute()

auto MoveEntityAction::execute ( ) ->void
overridevirtual

Virtual function that is called every frame to change a game object.

Reimplemented from Action.

Here is the call graph for this function:

◆ init()

auto MoveEntityAction::init ( ) ->void
overridevirtual

Virtual function that is called once, when the Action is first starting up.

Reimplemented from Action.

◆ operator=() [1/2]

auto MoveEntityAction::operator= ( const MoveEntityAction & ) ->MoveEntityAction &=default
default
Here is the call graph for this function:

◆ operator=() [2/2]

auto MoveEntityAction::operator= ( MoveEntityAction && other) ->MoveEntityAction &=default
defaultnoexcept
Here is the call graph for this function:

◆ render()

void MoveEntityAction::render ( ) const->void
overridevirtual

Function used to draw things to screen, useful for things such as debug drawing.

Todo
: Implement an arrow showing where the entity is moving

Reimplemented from Action.

Member Data Documentation

◆ endingPosition

Point2D MoveEntityAction::endingPosition
private

◆ objectTransform

Transform* MoveEntityAction::objectTransform = nullptr
private

◆ startingPosition

Point2D MoveEntityAction::startingPosition
private

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