123#include <unordered_map>
239 std::unordered_map<std::string, AnimationSequence>
animations;
349 std::unordered_map<std::string, AnimationState>
states;
364 return (
it !=
states.end()) ? &
it->second :
nullptr;
384 for (
const auto&
target :
it->second.transitions)
SDL_Texture * TextureHandle
ComponentTypeID GetComponentTypeID_Static()
Hotspot(float _x, float _y)
ParameterValue(float val)
ParameterValue(const std::string &val)
Collection of animations for an entity with multi-spritesheet support.
int margin
Margin around spritesheet edges in pixels.
std::string bankId
Unique identifier for this animation bank.
const AnimationSequence * GetSequence(const std::string &name) const
Get animation sequence by name.
std::vector< SpritesheetInfo > spritesheets
int frameWidth
Width of each frame in pixels.
SpritesheetInfo * GetSpritesheet(const std::string &id)
int frameHeight
Height of each frame in pixels.
std::string lastModifiedDate
AnimationSequence * GetSequence(const std::string &name)
const SpritesheetInfo * GetSpritesheet(const std::string &id) const
Get spritesheet by ID.
SDL_FRect CalculateFrameRect(int frameIndex) const
DEPRECATED: Calculate source rectangle for a frame based on spritesheet layout.
std::vector< std::string > tags
int columns
Number of columns in spritesheet.
std::unordered_map< std::string, AnimationSequence > animations
const AnimationSequence * GetAnimation(const std::string &name) const
DEPRECATED: Get animation sequence by name (use GetSequence() instead)
int spacing
Spacing between frames in pixels.
Represents a single frame in an animation (DEPRECATED - use SpritesheetInfo + frame ranges)
SDL_FRect srcRect
Source rectangle in spritesheet (x, y, w, h)
SDL_FPoint hotSpot
Render offset (pivot point)
std::string eventName
Optional event triggered when this frame starts (empty if none)
float duration
Duration of this frame in seconds.
Animation state machine (FSM) for managing transitions.
bool CanTransition(const std::string &from, const std::string &to) const
Check if transition from one state to another is valid.
const AnimationState * GetState(const std::string &name) const
Get state by name.
std::unordered_map< std::string, AnimationState > states
std::string graphId
Unique identifier for this graph.
std::string defaultState
Initial animation state.
Defines a complete animation sequence.
bool loop
Whether animation loops.
int frameCount
Number of frames in sequence.
std::string spritesheetPath
Path to spritesheet texture.
int startFrame
Starting frame index (0-based)
int GetFrameCount() const
std::vector< AnimationFrame > frames
Frame data.
std::string name
Animation name (e.g., "idle", "walk")
float frameDuration
Duration of each frame in seconds.
float GetEffectiveFPS() const
std::string nextAnimation
Animation to play after this one.
float speed
Speed multiplier.
float GetTotalDuration() const
std::string spritesheetId
References SpritesheetInfo.id.
std::vector< std::string > transitions
Metadata for a single spritesheet within an animation bank.
int totalFrames
Total number of frames available.
int rows
Number of rows in spritesheet.
int frameHeight
Height of each frame in pixels.
int columns
Number of columns in spritesheet.
int frameWidth
Width of each frame in pixels.
std::string path
Relative path to image.
SDL_FPoint hotspot
Default hotspot/pivot point.
int margin
Margin around spritesheet edges.
SpritesheetInfo()=default
std::string id
Unique identifier (e.g., "thesee_idle")
int spacing
Spacing between frames in pixels.