|
R-Type
Distributed multiplayer game engine in C++
|
Component managing current animation playback state. More...
#include <Animation.hpp>


Public Member Functions | |
| Animation (const std::string &initialClip="idle", bool loop=true, bool isPlaying=true) | |
| Constructor with animation parameters. | |
| ~Animation () override=default | |
| std::string | getCurrentClipName () const |
| Get the current animation clip name. | |
| float | getTimer () const |
| Get the playback timer. | |
| int | getCurrentFrameIndex () const |
| Get the current frame index. | |
| bool | isPlaying () const |
| Check if animation is playing. | |
| bool | isLooping () const |
| Check if animation is looping. | |
| void | setCurrentClipName (const std::string &clipName) |
| Set the current animation clip name. | |
| void | setTimer (float timer) |
| Set the playback timer. | |
| void | setCurrentFrameIndex (int frameIndex) |
| Set the current frame index. | |
| void | setPlaying (bool playing) |
| Set the playing state. | |
| void | setLoop (bool loop) |
| Set the looping state. | |
| ComponentType | getType () const override |
| Get the component type ID. | |
Public Member Functions inherited from ecs::IComponent | |
| virtual | ~IComponent ()=default |
| Virtual destructor. | |
Private Attributes | |
| std::string | _currentClipName |
| Current animation clip name. | |
| float | _timer |
| Playback timer in seconds. | |
| int | _currentFrameIndex |
| Current frame index. | |
| bool | _isPlaying |
| Animation playing state. | |
| bool | _loop |
| Animation looping flag. | |
Component managing current animation playback state.
Stores the current animation state including which animation clip is playing, the current frame index, playback timer, and control flags for playback behavior.
Definition at line 21 of file Animation.hpp.
|
inline |
Constructor with animation parameters.
| initialClip | Initial animation clip name |
| loop | Whether the animation should loop |
| isPlaying | Whether animation starts playing immediately |
Definition at line 29 of file Animation.hpp.
|
overridedefault |
|
inline |
Get the current animation clip name.
Definition at line 42 of file Animation.hpp.
References _currentClipName.
Referenced by server::GameLogic::_applyPlayerInput(), and ecs::AnimationSystem::update().
|
inline |
Get the current frame index.
Definition at line 54 of file Animation.hpp.
References _currentFrameIndex.
Referenced by ecs::AnimationSystem::update().
|
inline |
Get the playback timer.
Definition at line 48 of file Animation.hpp.
References _timer.
Referenced by ecs::AnimationSystem::update().
|
inlineoverridevirtual |
Get the component type ID.
Implements ecs::IComponent.
Definition at line 102 of file Animation.hpp.
|
inline |
Check if animation is looping.
Definition at line 66 of file Animation.hpp.
References _loop.
|
inline |
Check if animation is playing.
Definition at line 60 of file Animation.hpp.
References _isPlaying.
Referenced by ecs::AnimationSystem::update().
|
inline |
Set the current animation clip name.
| clipName | New animation clip identifier |
Definition at line 72 of file Animation.hpp.
References _currentClipName.
Referenced by server::GameLogic::_applyPlayerInput(), and ecs::AnimationSystem::update().
|
inline |
Set the current frame index.
| frameIndex | New frame index |
Definition at line 84 of file Animation.hpp.
References _currentFrameIndex.
Referenced by server::GameLogic::_applyPlayerInput(), and ecs::AnimationSystem::update().
|
inline |
Set the looping state.
| loop | True to enable looping |
Definition at line 96 of file Animation.hpp.
References _loop.
|
inline |
Set the playing state.
| playing | True to play, false to pause |
Definition at line 90 of file Animation.hpp.
References _isPlaying.
Referenced by ecs::AnimationSystem::update().
|
inline |
Set the playback timer.
| timer | New timer value in seconds |
Definition at line 78 of file Animation.hpp.
References _timer.
Referenced by server::GameLogic::_applyPlayerInput(), and ecs::AnimationSystem::update().
|
private |
Current animation clip name.
Definition at line 105 of file Animation.hpp.
Referenced by getCurrentClipName(), and setCurrentClipName().
|
private |
Current frame index.
Definition at line 107 of file Animation.hpp.
Referenced by getCurrentFrameIndex(), and setCurrentFrameIndex().
|
private |
Animation playing state.
Definition at line 108 of file Animation.hpp.
Referenced by isPlaying(), and setPlaying().
|
private |
Animation looping flag.
Definition at line 109 of file Animation.hpp.
Referenced by isLooping(), and setLoop().
|
private |
Playback timer in seconds.
Definition at line 106 of file Animation.hpp.
Referenced by getTimer(), and setTimer().