R-Type
Distributed multiplayer game engine in C++
Loading...
Searching...
No Matches
AnimDB Namespace Reference

Typedefs

using AnimationFactory = std::function< ecs::AnimationSet()>
 Factory function type for animation set creation.
 

Functions

ecs::AnimationClip makeClip (std::initializer_list< ecs::Rectangle > frames, float duration=0.1f, bool loop=true, const std::string &nextClip="")
 Helper to create animation clips easily.
 
ecs::AnimationSet createPlayerAnimations ()
 Create player ship animations.
 
ecs::AnimationSet createOrbitalModuleAnimations ()
 Create drone (orbital module) animations.
 
ecs::AnimationSet createEnemyBasicAnimations ()
 Create basic enemy animations.
 
ecs::AnimationSet createEnemyWalkingAnimations ()
 Create walking enemy animations.
 
ecs::AnimationSet createBossBodyAnimations ()
 Create boss body animations.
 
ecs::AnimationSet createBossArmAnimations ()
 Create boss arm animations.
 
ecs::AnimationSet createPlayerBulletAnimations ()
 Create player bullet animations.
 
ecs::AnimationSet createEnemyBulletAnimations ()
 Create enemy bullet animations.
 
ecs::AnimationSet getAnimationSet (const std::string &entityType)
 Get an AnimationSet by entity type.
 

Variables

const std::unordered_map< std::string, AnimationFactoryFACTORIES
 Map of entity types to their animation factory functions.
 

Typedef Documentation

◆ AnimationFactory

using AnimDB::AnimationFactory = typedef std::function<ecs::AnimationSet()>

Factory function type for animation set creation.

Definition at line 210 of file AnimationDatabase.hpp.

Function Documentation

◆ createBossArmAnimations()

ecs::AnimationSet AnimDB::createBossArmAnimations ( )
inline

Create boss arm animations.

Returns
ecs::AnimationSet Complete animation set for boss arm

Definition at line 160 of file AnimationDatabase.hpp.

References ecs::AnimationSet::addClip(), and makeClip().

Here is the call graph for this function:

◆ createBossBodyAnimations()

ecs::AnimationSet AnimDB::createBossBodyAnimations ( )
inline

Create boss body animations.

Returns
ecs::AnimationSet Complete animation set for boss body

Definition at line 139 of file AnimationDatabase.hpp.

References ecs::AnimationSet::addClip(), and makeClip().

Here is the call graph for this function:

◆ createEnemyBasicAnimations()

ecs::AnimationSet AnimDB::createEnemyBasicAnimations ( )
inline

Create basic enemy animations.

Returns
ecs::AnimationSet Complete animation set for basic enemy

Definition at line 82 of file AnimationDatabase.hpp.

References ecs::AnimationSet::addClip(), and makeClip().

Here is the call graph for this function:

◆ createEnemyBulletAnimations()

ecs::AnimationSet AnimDB::createEnemyBulletAnimations ( )
inline

Create enemy bullet animations.

Returns
ecs::AnimationSet Complete animation set for enemy projectile

Definition at line 198 of file AnimationDatabase.hpp.

References ecs::AnimationSet::addClip(), and makeClip().

Here is the call graph for this function:

◆ createEnemyWalkingAnimations()

ecs::AnimationSet AnimDB::createEnemyWalkingAnimations ( )
inline

Create walking enemy animations.

Returns
ecs::AnimationSet Complete animation set for walking enemy

Definition at line 112 of file AnimationDatabase.hpp.

References ecs::AnimationSet::addClip(), and makeClip().

Here is the call graph for this function:

◆ createOrbitalModuleAnimations()

ecs::AnimationSet AnimDB::createOrbitalModuleAnimations ( )
inline

Create drone (orbital module) animations.

Returns
ecs::AnimationSet Complete animation set for orbital module

Definition at line 56 of file AnimationDatabase.hpp.

References ecs::AnimationSet::addClip(), and makeClip().

Referenced by ecs::PrefabFactory::createOrbitalModule().

Here is the call graph for this function:

◆ createPlayerAnimations()

ecs::AnimationSet AnimDB::createPlayerAnimations ( )
inline

Create player ship animations.

Returns
ecs::AnimationSet Complete animation set for player

Definition at line 35 of file AnimationDatabase.hpp.

References ecs::AnimationSet::addClip(), and makeClip().

Referenced by server::GameLogic::spawnPlayer().

Here is the call graph for this function:

◆ createPlayerBulletAnimations()

ecs::AnimationSet AnimDB::createPlayerBulletAnimations ( )
inline

Create player bullet animations.

Returns
ecs::AnimationSet Complete animation set for player projectile

Definition at line 178 of file AnimationDatabase.hpp.

References ecs::AnimationSet::addClip(), and makeClip().

Referenced by ecs::PrefabFactory::createProjectile(), and ecs::WeaponSystem::createProjectile().

Here is the call graph for this function:

◆ getAnimationSet()

ecs::AnimationSet AnimDB::getAnimationSet ( const std::string &  entityType)
inline

Get an AnimationSet by entity type.

Parameters
entityTypeType identifier (e.g., "player", "enemy_basic")
Returns
ecs::AnimationSet The animation set for the entity type
Note
Returns a default AnimationSet if entity type is not found

Definition at line 233 of file AnimationDatabase.hpp.

References ecs::AnimationSet::addClip(), FACTORIES, and makeClip().

Here is the call graph for this function:

◆ makeClip()

ecs::AnimationClip AnimDB::makeClip ( std::initializer_list< ecs::Rectangle frames,
float  duration = 0.1f,
bool  loop = true,
const std::string &  nextClip = "" 
)
inline

Helper to create animation clips easily.

Parameters
framesInitializer list of frame rectangles
durationDuration per frame in seconds
loopWhether animation loops
nextClipNext animation clip to play after completion
Returns
ecs::AnimationClip The constructed animation clip

Definition at line 25 of file AnimationDatabase.hpp.

Referenced by createBossArmAnimations(), createBossBodyAnimations(), createEnemyBasicAnimations(), createEnemyBulletAnimations(), createEnemyWalkingAnimations(), createOrbitalModuleAnimations(), createPlayerAnimations(), createPlayerBulletAnimations(), and getAnimationSet().

Variable Documentation

◆ FACTORIES

const std::unordered_map<std::string, AnimationFactory> AnimDB::FACTORIES
inline
Initial value:
= {
{"enemy_basic", createEnemyBasicAnimations},
{"boss_body", createBossBodyAnimations},
{"boss_arm", createBossArmAnimations},
{"player_bullet", createPlayerBulletAnimations},
{"enemy_bullet", createEnemyBulletAnimations}}
ecs::AnimationSet createPlayerAnimations()
Create player ship animations.
ecs::AnimationSet createEnemyBasicAnimations()
Create basic enemy animations.
ecs::AnimationSet createPlayerBulletAnimations()
Create player bullet animations.
ecs::AnimationSet createEnemyBulletAnimations()
Create enemy bullet animations.
ecs::AnimationSet createBossArmAnimations()
Create boss arm animations.

Map of entity types to their animation factory functions.

Use this to quickly get an AnimationSet for any entity type.

Definition at line 217 of file AnimationDatabase.hpp.

Referenced by getAnimationSet().