nomlib
Loading...
Searching...
No Matches
nom::RemoveAction Class Reference

Free the external resources held by an action. More...

#include <RemoveAction.hpp>

Inheritance diagram for nom::RemoveAction:
[legend]

Public Types

typedef RemoveAction self_type
typedef IActionObject derived_type
Public Types inherited from nom::IActionObject
enum  FrameState { COMPLETED , PLAYING }
 The update status of the action. More...
typedef IActionObject self_type
typedef std::function< real32(real32, real32, real32, real32)> timing_curve_func
 A function pointer to a timing mode.

Public Member Functions

 RemoveAction (const std::shared_ptr< IActionObject > &action)
 Free the external resources held by an action.
virtual std::unique_ptr< IActionObject > clone () const override
 Create a deep copy instance of the action.
virtual IActionObject::FrameState next_frame (real32 delta_time) override
 Play the action forward in time by one time step.
virtual IActionObject::FrameState prev_frame (real32 delta_time) override
 Play the action backwards in time by one time step.
virtual void pause (real32 delta_time) override
 This action does not support being paused.
virtual void resume (real32 delta_time) override
 This action does not support being resumed.
virtual void rewind (real32 delta_time) override
 This action does not support being reset.
virtual void release () override
 Free externally referenced resources held by the action.
Public Member Functions inherited from nom::IActionObject
const std::string & name () const
 Get the unique identifier of the action.
real32 duration () const
 Get the duration of the action.
real32 speed () const
 Get the speed modifier of the action.
const IActionObject::timing_curve_functiming_curve () const
 Get the timing mode function used by the action.
void set_name (const std::string &action_id)
 Set the unique identifier of the action.
virtual void set_speed (real32 speed)
 Set the speed factor of the action.
virtual void set_timing_curve (const IActionObject::timing_curve_func &mode)
 Set the timing mode of the action.

Private Attributes

std::shared_ptr< IActionObject > action_
 The child action.

Static Private Attributes

static const char * DEBUG_CLASS_NAME

Friends

class ActionTest
 Allow access into our private parts for unit testing.

Additional Inherited Members

Protected Member Functions inherited from nom::IActionObject
IActionObject::FrameState status () const
 Get the current state of the action.
void set_duration (real32 seconds)
 Set the duration of the action.
void set_status (FrameState state)
 Set the state of the action.
Protected Attributes inherited from nom::IActionObject
real32 elapsed_frames_ = 0.0f
 Internal frames counter.
Timer timer_
 Internal time clock (milliseconds resolution).

Detailed Description

Free the external resources held by an action.

This interface exists essentially as a placeholder until the engine's infrastructure is further developed. The current interface allows for the convenient removal of sprites from being rendered, instead of always needing to check to see if the action is running before rendering the action's sprite.

Remarks
This action is not reversible; the reverse of this action is the same action.

Definition at line 40 of file RemoveAction.hpp.

Member Typedef Documentation

◆ derived_type

typedef IActionObject nom::RemoveAction::derived_type

Definition at line 47 of file RemoveAction.hpp.

◆ self_type

typedef RemoveAction nom::RemoveAction::self_type

Definition at line 46 of file RemoveAction.hpp.

Constructor & Destructor Documentation

◆ RemoveAction()

nom::RemoveAction::RemoveAction ( const std::shared_ptr< IActionObject > & action)

Free the external resources held by an action.

Parameters
actionThe action to free its resources from; NULL actions are valid.
Remarks
The action is executed instantaneously.

Member Function Documentation

◆ clone()

virtual std::unique_ptr< IActionObject > nom::RemoveAction::clone ( ) const
overridevirtual

Create a deep copy instance of the action.

Remarks
A cloned instance is created using the action's attributes at the time of construction. External resources of the action – i.e.: nom::Sprite – are not modified, and you may need to reset the state appropriately if the action has been ran previously.

Implements nom::IActionObject.

◆ next_frame()

virtual IActionObject::FrameState nom::RemoveAction::next_frame ( real32 delta_time)
overridevirtual

Play the action forward in time by one time step.

Parameters
delta_timeReserved for application-defined implementations.
Note
This method should not normally need to be called externally! Exceptions might include: a) implementing a new action; b) advanced debugging
See also
nom::DispatchQueue

Implements nom::IActionObject.

◆ pause()

virtual void nom::RemoveAction::pause ( real32 delta_time)
overridevirtual

This action does not support being paused.

Implements nom::IActionObject.

◆ prev_frame()

virtual IActionObject::FrameState nom::RemoveAction::prev_frame ( real32 delta_time)
overridevirtual

Play the action backwards in time by one time step.

Parameters
delta_timeReserved for application-defined implementations.
Note
This method should not normally need to be called externally! Exceptions might include: a) implementing a new action; b) advanced debugging
Remarks
Not all actions are reversible – see the action's documentation for its implementation details.
See also
nom::ReversedAction

Implements nom::IActionObject.

◆ release()

virtual void nom::RemoveAction::release ( )
overridevirtual

Free externally referenced resources held by the action.

Note
This method should not normally need to be called externally! Exceptions might include: a) implementing a new action; b) advanced debugging
See also
nom::RemoveAction

Implements nom::IActionObject.

◆ resume()

virtual void nom::RemoveAction::resume ( real32 delta_time)
overridevirtual

This action does not support being resumed.

Implements nom::IActionObject.

◆ rewind()

virtual void nom::RemoveAction::rewind ( real32 delta_time)
overridevirtual

This action does not support being reset.

Implements nom::IActionObject.

◆ ActionTest

friend class ActionTest
friend

Allow access into our private parts for unit testing.

Definition at line 44 of file RemoveAction.hpp.

Member Data Documentation

◆ action_

std::shared_ptr<IActionObject> nom::RemoveAction::action_
private

The child action.

Definition at line 80 of file RemoveAction.hpp.

◆ DEBUG_CLASS_NAME

const char* nom::RemoveAction::DEBUG_CLASS_NAME
staticprivate

Definition at line 77 of file RemoveAction.hpp.


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