Represents a discrete, repeatable operation run by a Tickable.
More...
#include <Action.h>
|
| | Action (std::shared_ptr< Tickable > tickable) |
| | Constructs an Action associated with a Tickable.
|
| |
| virtual | ~Action ()=default |
| |
| std::shared_ptr< Tickable > | GetTickable () const |
| | Returns the Tickable that owns this Action, or nullptr if expired.
|
| |
| bool | Run () |
| | Executes the Action if it is currently running.
|
| |
| bool | IsRunning () const |
| | Returns true if this Action is currently in the running state.
|
| |
| bool | Start (const bool force=false) |
| | Starts the Action so that subsequent Run() calls will execute it.
|
| |
| bool | Stop (const bool force=false) |
| | Stops the Action so that subsequent Run() calls become no-ops.
|
| |
| virtual bool | CanStart () |
| | Permission hook; override to prevent starting. Defaults to true.
|
| |
| virtual bool | CanStop () |
| | Permission hook; override to prevent stopping. Defaults to true.
|
| |
| virtual void | Started (const bool forced) |
| | Notification hook called after the Action has been started.
|
| |
| virtual void | Stopped (const bool forced) |
| | Notification hook called after the Action has been stopped.
|
| |
| double | GetTime (const ClockType clockType) const |
| | Returns the wall-clock time for a profiling checkpoint.
|
| |
| | Part () |
| | Constructs a Part and assigns it a unique ID.
|
| |
| | Part (std::shared_ptr< Context > context) |
| | Constructs a Part with an explicit Context reference and unique ID.
|
| |
| virtual | ~Part ()=default |
| |
| uint64_t | GetId () const |
| | Returns the unique identifier for this Part.
|
| |
| bool | operator== (const Part &other) const |
| | Compares two Parts for equality by their unique IDs.
|
| |
| std::shared_ptr< Context > | GetContext () const |
| | Returns the Context this Part belongs to, or nullptr if unset.
|
| |
| void | SetContext (std::shared_ptr< Context > ctx) |
| | Sets the Context this Part belongs to.
|
| |
Represents a discrete, repeatable operation run by a Tickable.
Actions are owned by a Tickable and executed each frame/tick. Subclasses define behavior via ActionRan().
For event-driven actions that need dispatching via EventID, use EventAction.
◆ Action()
| Ship::Action::Action |
( |
std::shared_ptr< Tickable > |
tickable | ) |
|
◆ ~Action()
| virtual Ship::Action::~Action |
( |
| ) |
|
|
virtualdefault |
◆ ActionRan()
| virtual bool Ship::Action::ActionRan |
( |
| ) |
|
|
protectedpure virtual |
◆ CanStart()
| virtual bool Ship::Action::CanStart |
( |
| ) |
|
|
virtual |
Permission hook; override to prevent starting. Defaults to true.
◆ CanStop()
| virtual bool Ship::Action::CanStop |
( |
| ) |
|
|
virtual |
Permission hook; override to prevent stopping. Defaults to true.
◆ GetTickable()
| std::shared_ptr< Tickable > Ship::Action::GetTickable |
( |
| ) |
const |
◆ GetTime()
| double Ship::Action::GetTime |
( |
const ClockType |
clockType | ) |
const |
Returns the wall-clock time for a profiling checkpoint.
- Parameters
-
| clockType | Which checkpoint to query. |
- Returns
- Elapsed time in seconds since the epoch for the requested checkpoint.
◆ IsRunning()
| bool Ship::Action::IsRunning |
( |
| ) |
const |
Returns true if this Action is currently in the running state.
◆ Run()
| bool Ship::Action::Run |
( |
| ) |
|
Executes the Action if it is currently running.
- Returns
- True if the Action executed successfully.
◆ Start()
| bool Ship::Action::Start |
( |
const bool |
force = false | ) |
|
Starts the Action so that subsequent Run() calls will execute it.
- Parameters
-
- Returns
- True if the Action was successfully started.
◆ Started()
| virtual void Ship::Action::Started |
( |
const bool |
forced | ) |
|
|
virtual |
Notification hook called after the Action has been started.
- Parameters
-
| forced | Whether the start bypassed permission checks. |
◆ Stop()
| bool Ship::Action::Stop |
( |
const bool |
force = false | ) |
|
Stops the Action so that subsequent Run() calls become no-ops.
- Parameters
-
- Returns
- True if the Action was successfully stopped.
◆ Stopped()
| virtual void Ship::Action::Stopped |
( |
const bool |
forced | ) |
|
|
virtual |
Notification hook called after the Action has been stopped.
- Parameters
-
| forced | Whether the stop bypassed permission checks. |
The documentation for this class was generated from the following file: