Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
OlympeAnimation::AnimationManager Class Reference

#include <AnimationManager.h>

Public Member Functions

void Init ()
 
void LoadAnimationBanks (const std::string &directoryPath)
 
void LoadAnimationGraphs (const std::string &directoryPath)
 
bool LoadAnimationBank (const std::string &filePath)
 
bool LoadAnimationGraph (const std::string &filePath)
 
AnimationBankGetBank (const std::string &bankName)
 
const AnimationBankGetBank (const std::string &bankName) const
 
AnimationGraphGetGraph (const std::string &graphName)
 
const AnimationGraphGetGraph (const std::string &graphName) const
 
const Olympe::AnimationSequenceGetAnimationSequence (const std::string &bankId, const std::string &animName) const
 Get animation sequence from a bank by name.
 
bool HasAnimation (const std::string &bankId, const std::string &animName) const
 Check if animation exists in bank.
 
void Shutdown ()
 

Static Public Member Functions

static AnimationManagerGetInstance ()
 
static AnimationManagerGet ()
 

Private Member Functions

 AnimationManager ()=default
 
 ~AnimationManager ()=default
 
 AnimationManager (const AnimationManager &)=delete
 
AnimationManageroperator= (const AnimationManager &)=delete
 
std::vector< std::string > ScanDirectory (const std::string &directoryPath)
 

Private Attributes

bool m_initialized = false
 
std::unordered_map< std::string, std::unique_ptr< AnimationBank > > m_banks
 
std::unordered_map< std::string, std::unique_ptr< AnimationGraph > > m_graphs
 

Detailed Description

Definition at line 24 of file AnimationManager.h.

Constructor & Destructor Documentation

◆ AnimationManager() [1/2]

OlympeAnimation::AnimationManager::AnimationManager ( )
privatedefault

◆ ~AnimationManager()

OlympeAnimation::AnimationManager::~AnimationManager ( )
privatedefault

◆ AnimationManager() [2/2]

OlympeAnimation::AnimationManager::AnimationManager ( const AnimationManager )
privatedelete

Member Function Documentation

◆ Get()

static AnimationManager & OlympeAnimation::AnimationManager::Get ( )
inlinestatic

Definition at line 33 of file AnimationManager.h.

References GetInstance().

Referenced by GameEngine::Initialize(), World::Initialize_ECS_Systems(), AnimationSystem::ResolveAnimationSequence(), and AnimationSystem::UpdateEntity().

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

◆ GetAnimationSequence()

const Olympe::AnimationSequence * OlympeAnimation::AnimationManager::GetAnimationSequence ( const std::string &  bankId,
const std::string &  animName 
) const

Get animation sequence from a bank by name.

Parameters
bankIdAnimation bank identifier
animNameAnimation name within the bank
Returns
Pointer to AnimationSequence if found, nullptr otherwise

Helper function to avoid manual bank lookup + animation lookup.

Example:

auto* seq = AnimationManager::Get().GetAnimationSequence("player", "walk");
if (seq) {
// Use sequence
}
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
static AnimationManager & Get()
const Olympe::AnimationSequence * GetAnimationSequence(const std::string &bankId, const std::string &animName) const
Get animation sequence from a bank by name.

Definition at line 116 of file AnimationManager.cpp.

References GetComponentTypeID_Static(), and m_banks.

Referenced by AnimationSystem::ResolveAnimationSequence().

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

◆ GetBank() [1/2]

AnimationBank * OlympeAnimation::AnimationManager::GetBank ( const std::string &  bankName)

Definition at line 83 of file AnimationManager.cpp.

References GetComponentTypeID_Static(), and m_banks.

Referenced by AnimationSystem::UpdateEntity().

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

◆ GetBank() [2/2]

const AnimationBank * OlympeAnimation::AnimationManager::GetBank ( const std::string &  bankName) const

Definition at line 91 of file AnimationManager.cpp.

References GetComponentTypeID_Static(), and m_banks.

+ Here is the call graph for this function:

◆ GetGraph() [1/2]

AnimationGraph * OlympeAnimation::AnimationManager::GetGraph ( const std::string &  graphName)

Definition at line 99 of file AnimationManager.cpp.

References GetComponentTypeID_Static(), and m_graphs.

+ Here is the call graph for this function:

◆ GetGraph() [2/2]

const AnimationGraph * OlympeAnimation::AnimationManager::GetGraph ( const std::string &  graphName) const

Definition at line 107 of file AnimationManager.cpp.

References GetComponentTypeID_Static(), and m_graphs.

+ Here is the call graph for this function:

◆ GetInstance()

static AnimationManager & OlympeAnimation::AnimationManager::GetInstance ( )
inlinestatic

Definition at line 28 of file AnimationManager.h.

References GetComponentTypeID_Static().

Referenced by Get().

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

◆ HasAnimation()

bool OlympeAnimation::AnimationManager::HasAnimation ( const std::string &  bankId,
const std::string &  animName 
) const

Check if animation exists in bank.

Parameters
bankIdBank identifier
animNameAnimation name
Returns
true if animation exists

Definition at line 149 of file AnimationManager.cpp.

References OlympeAnimation::AnimationBank::GetAnimation(), GetComponentTypeID_Static(), and m_banks.

+ Here is the call graph for this function:

◆ Init()

void OlympeAnimation::AnimationManager::Init ( )

Definition at line 24 of file AnimationManager.cpp.

References m_initialized, and SYSTEM_LOG.

Referenced by GameEngine::Initialize().

+ Here is the caller graph for this function:

◆ LoadAnimationBank()

bool OlympeAnimation::AnimationManager::LoadAnimationBank ( const std::string &  filePath)

Definition at line 59 of file AnimationManager.cpp.

References GetComponentTypeID_Static(), and m_banks.

Referenced by LoadAnimationBanks().

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

◆ LoadAnimationBanks()

void OlympeAnimation::AnimationManager::LoadAnimationBanks ( const std::string &  directoryPath)

Definition at line 33 of file AnimationManager.cpp.

References GetComponentTypeID_Static(), LoadAnimationBank(), m_banks, ScanDirectory(), and SYSTEM_LOG.

Referenced by GameEngine::Initialize(), and World::Initialize_ECS_Systems().

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

◆ LoadAnimationGraph()

bool OlympeAnimation::AnimationManager::LoadAnimationGraph ( const std::string &  filePath)

Definition at line 71 of file AnimationManager.cpp.

References GetComponentTypeID_Static(), and m_graphs.

Referenced by LoadAnimationGraphs().

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

◆ LoadAnimationGraphs()

void OlympeAnimation::AnimationManager::LoadAnimationGraphs ( const std::string &  directoryPath)

Definition at line 46 of file AnimationManager.cpp.

References GetComponentTypeID_Static(), LoadAnimationGraph(), m_graphs, ScanDirectory(), and SYSTEM_LOG.

Referenced by GameEngine::Initialize(), and World::Initialize_ECS_Systems().

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

◆ operator=()

AnimationManager & OlympeAnimation::AnimationManager::operator= ( const AnimationManager )
privatedelete

◆ ScanDirectory()

std::vector< std::string > OlympeAnimation::AnimationManager::ScanDirectory ( const std::string &  directoryPath)
private

Definition at line 178 of file AnimationManager.cpp.

References GetComponentTypeID_Static(), and SYSTEM_LOG.

Referenced by LoadAnimationBanks(), and LoadAnimationGraphs().

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

◆ Shutdown()

void OlympeAnimation::AnimationManager::Shutdown ( )

Definition at line 170 of file AnimationManager.cpp.

References m_banks, m_graphs, m_initialized, and SYSTEM_LOG.

Member Data Documentation

◆ m_banks

std::unordered_map<std::string, std::unique_ptr<AnimationBank> > OlympeAnimation::AnimationManager::m_banks
private

◆ m_graphs

std::unordered_map<std::string, std::unique_ptr<AnimationGraph> > OlympeAnimation::AnimationManager::m_graphs
private

◆ m_initialized

bool OlympeAnimation::AnimationManager::m_initialized = false
private

Definition at line 95 of file AnimationManager.h.

Referenced by Init(), and Shutdown().


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