galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages Concepts
galaxy::components::Animated Class Referencefinal

Allows for an entity to be animated. More...

#include <Animated.hpp>

+ Inheritance diagram for galaxy::components::Animated:
+ Collaboration diagram for galaxy::components::Animated:

Public Member Functions

 Animated ()
 Constructor.
 
 Animated (const nlohmann::json &json)
 JSON constructor.
 
 Animated (Animated &&)
 Move constructor.
 
Animatedoperator= (Animated &&)
 Move assignment operator.
 
virtual ~Animated ()
 Destructor.
 
void set_animation (const std::string &animation)
 Sets the active animation.
 
nlohmann::json serialize () override
 Serializes object.
 
void deserialize (const nlohmann::json &json) override
 Deserializes from object.
 
- Public Member Functions inherited from galaxy::fs::Serializable
virtual ~Serializable ()
 Destructor.
 
virtual Serializableoperator= (Serializable &&)=default
 Move assignment operator.
 
virtual Serializableoperator= (const Serializable &)=default
 Copy assignment operator.
 

Public Attributes

bool m_paused
 Is the animation paused.
 
double m_duration
 Time spent on current frame.
 
graphics::Animation * m_anim
 Animation object.
 

Private Member Functions

 Animated (const Animated &)=delete
 Copy constructor.
 
Animatedoperator= (const Animated &)=delete
 Copy assignment operator.
 

Additional Inherited Members

- Protected Member Functions inherited from galaxy::fs::Serializable
 Serializable ()
 Constructor.
 

Detailed Description

Allows for an entity to be animated.

Definition at line 21 of file Animated.hpp.

Constructor & Destructor Documentation

◆ Animated() [1/4]

galaxy::components::Animated::Animated ( )

Constructor.

Definition at line 19 of file Animated.cpp.

◆ Animated() [2/4]

galaxy::components::Animated::Animated ( const nlohmann::json & json)

JSON constructor.

Parameters
jsonJSON defining object.

Definition at line 27 of file Animated.cpp.

+ Here is the call graph for this function:

◆ Animated() [3/4]

galaxy::components::Animated::Animated ( Animated && a)

Move constructor.

Definition at line 33 of file Animated.cpp.

◆ ~Animated()

galaxy::components::Animated::~Animated ( )
virtual

Destructor.

Definition at line 57 of file Animated.cpp.

◆ Animated() [4/4]

galaxy::components::Animated::Animated ( const Animated & )
privatedelete

Copy constructor.

Member Function Documentation

◆ operator=() [1/2]

Animated & galaxy::components::Animated::operator= ( Animated && a)

Move assignment operator.

Definition at line 43 of file Animated.cpp.

◆ set_animation()

void galaxy::components::Animated::set_animation ( const std::string & animation)

Sets the active animation.

Parameters
animationAnimation to use.

Definition at line 62 of file Animated.cpp.

+ Here is the caller graph for this function:

◆ serialize()

nlohmann::json galaxy::components::Animated::serialize ( )
nodiscardoverridevirtual

Serializes object.

Returns
JSON object containing data to be serialized.

Implements galaxy::fs::Serializable.

Definition at line 68 of file Animated.cpp.

◆ deserialize()

void galaxy::components::Animated::deserialize ( const nlohmann::json & json)
overridevirtual

Deserializes from object.

Parameters
jsonJson object to retrieve data from.

Implements galaxy::fs::Serializable.

Definition at line 87 of file Animated.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=() [2/2]

Animated & galaxy::components::Animated::operator= ( const Animated & )
privatedelete

Copy assignment operator.

Member Data Documentation

◆ m_paused

bool galaxy::components::Animated::m_paused

Is the animation paused.

Definition at line 88 of file Animated.hpp.

◆ m_duration

double galaxy::components::Animated::m_duration

Time spent on current frame.

Definition at line 93 of file Animated.hpp.

◆ m_anim

graphics::Animation* galaxy::components::Animated::m_anim

Animation object.

Definition at line 98 of file Animated.hpp.


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