CSEngine
Loading...
Searching...
No Matches
CSE::Animation Class Reference
Inheritance diagram for CSE::Animation:
CSE::SResource CSE::SObject CSE::VariableBinder CSE::ReflectionObject

Public Member Functions

 RESOURCE_DEFINE_CONSTRUCTOR (Animation)
 
 Animation (float totalTime, std::list< KeyFrame * > keyframes)
 
void SetKeyframe (float totalTime, std::list< KeyFrame * > keyframes)
 
void Exterminate () override
 
float GetLength () const
 
std::list< KeyFrame * > GetKeyFrames () const
 
void SetValue (std::string name_str, Arguments value) override
 
std::string PrintValue () const override
 
- Public Member Functions inherited from CSE::SResource
 SResource (std::string classType)
 
 SResource (const SResource *resource, bool isRegister)
 
void SetName (std::string name)
 
void SetAbsoluteID (std::string id)
 
std::string GetName () const
 
std::string GetAbsoluteID () const
 
AssetMgr::AssetReferenceGetAssetReference (std::string hash="") const
 
void LinkResource (AssetMgr::AssetReference *asset)
 
void LinkResource (std::string name)
 
void SetHash (std::string &hash) override
 
- Public Member Functions inherited from CSE::SObject
 SObject (bool isRegister)
 
virtual void SetUndestroyable (bool enable)
 
virtual void Destroy ()
 
std::string GetHash () const
 
- Public Member Functions inherited from CSE::VariableBinder
- Public Member Functions inherited from CSE::ReflectionObject
 ReflectionObject (std::string type)
 
void SetClassType (std::string type)
 
const char * GetClassType () const
 
bool IsSameClass (const char *classType) const
 

Protected Member Functions

void Init (const AssetMgr::AssetReference *asset) override
 
- Protected Member Functions inherited from CSE::SResource
- Protected Member Functions inherited from CSE::VariableBinder

Additional Inherited Members

- Static Public Member Functions inherited from CSE::SResource
template<class T >
static T * Create (const std::string &name)
 
static SResourceCreate (const std::string &name, const std::string &classType)
 
template<class T >
static T * Create (const AssetMgr::AssetReference *asset)
 
static SResourceCreate (const AssetMgr::AssetReference *asset, const std::string &classType)
 
template<class T >
static T * Get (std::string name)
 
static SResourceGet (std::string &name)
 
- Static Public Member Functions inherited from CSE::ReflectionObject
static ReflectionObjectNewObject (const std::string &name)
 
- Protected Types inherited from CSE::VariableBinder
typedef std::vector< std::string > Arguments
 
- Protected Attributes inherited from CSE::SObject
std::string m_hash
 
- Protected Attributes inherited from CSE::ReflectionObject
std::string m_class
 

Detailed Description

Definition at line 20 of file Animation.h.

Constructor & Destructor Documentation

◆ Animation()

CSE::Animation::Animation ( float totalTime,
std::list< KeyFrame * > keyframes )
inline

Definition at line 24 of file Animation.h.

24 : CSE::SResource("Animation") {
25 SetUndestroyable(true);
26 m_length = totalTime;
27 m_keyframes = std::move(keyframes);
28 }

Member Function Documentation

◆ Exterminate()

void Animation::Exterminate ( )
overridevirtual

Implements CSE::SObject.

Definition at line 21 of file Animation.cpp.

21 {
22 for(auto keyframe : m_keyframes) {
23 SAFE_DELETE(keyframe);
24 }
25 m_keyframes.clear();
26}

◆ GetKeyFrames()

std::list< KeyFrame * > CSE::Animation::GetKeyFrames ( ) const
inline

Definition at line 40 of file Animation.h.

40 {
41 return m_keyframes;
42 }

◆ GetLength()

float CSE::Animation::GetLength ( ) const
inline

Definition at line 36 of file Animation.h.

36 {
37 return m_length;
38 }

◆ Init()

void Animation::Init ( const AssetMgr::AssetReference * asset)
overrideprotectedvirtual

Implements CSE::SResource.

Definition at line 28 of file Animation.cpp.

28 {
29 std::string parent_id = split(asset->id, '?')[0];
30 CORE->GetCore(ResMgr)->GetAssetReference(parent_id);
31}

◆ PrintValue()

std::string Animation::PrintValue ( ) const
overridevirtual

Implements CSE::VariableBinder.

Definition at line 36 of file Animation.cpp.

36 {
37 return {};
38}

◆ SetKeyframe()

void Animation::SetKeyframe ( float totalTime,
std::list< KeyFrame * > keyframes )

Definition at line 16 of file Animation.cpp.

16 {
17 m_length = totalTime;
18 m_keyframes = std::move(keyframes);
19}

◆ SetValue()

void Animation::SetValue ( std::string name_str,
Arguments value )
overridevirtual

Used to get serialized values. All classes that inherit from VariableBinder will unconditionally call this function first during initialization.

Parameters
name_strName of values
valueSerialized values

Implements CSE::VariableBinder.

Definition at line 33 of file Animation.cpp.

33 {
34}

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