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

Public Member Functions

 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
 
- Public Member Functions inherited from CSE::SResource
 SResource (bool isRegister)
 
 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 ()
 
virtual void __FORCE_DESTROY__ ()
 
virtual std::string GenerateMeta ()
 
std::string GetHash () const
 

Protected Member Functions

void Init (const AssetMgr::AssetReference *asset) override
 

Additional Inherited Members

- Static Public Member Functions inherited from CSE::SResource
template<class T >
static T * Create (const std::string &name)
 
template<class T >
static T * Create (const AssetMgr::AssetReference *asset)
 
template<class T >
static T * Get (std::string name)
 
- Protected Attributes inherited from CSE::SObject
std::string m_hash
 

Detailed Description

Definition at line 20 of file Animation.h.

Constructor & Destructor Documentation

◆ Animation() [1/2]

CSE::Animation::Animation ( )
inline

Definition at line 22 of file Animation.h.

22 {
23 SetUndestroyable(true);
24 }

◆ Animation() [2/2]

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

Definition at line 26 of file Animation.h.

26 {
27 SetUndestroyable(true);
28 m_length = totalTime;
29 m_keyframes = std::move(keyframes);
30 }

Member Function Documentation

◆ Exterminate()

void Animation::Exterminate ( )
overridevirtual

Implements CSE::SObject.

Definition at line 16 of file Animation.cpp.

16 {
17 for(auto keyframe : m_keyframes) {
18 SAFE_DELETE(keyframe);
19 }
20 m_keyframes.clear();
21}

◆ GetKeyFrames()

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

Definition at line 42 of file Animation.h.

42 {
43 return m_keyframes;
44 }

◆ GetLength()

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

Definition at line 38 of file Animation.h.

38 {
39 return m_length;
40 }

◆ Init()

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

Implements CSE::SResource.

Definition at line 23 of file Animation.cpp.

23 {
24 std::string parent_id = split(asset->id, '?')[0];
25 CORE->GetCore(ResMgr)->GetAssetReference(parent_id);
26
27}

◆ SetKeyframe()

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

Definition at line 11 of file Animation.cpp.

11 {
12 m_length = totalTime;
13 m_keyframes = std::move(keyframes);
14}

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