Definition: Animation.h:17
Animation()
Animation constructor.
void setSlowdownCount(int new_slowdown_count)
Set animation slowdown count (-1 means stop animation).
int m_index
Current index frame for Sprite.
Definition: Animation.h:21
std::string toString() const
Return attributes as string.
Box getBox() const
Get bounding box of associated Sprite.
int getIndex() const
Get index of current Sprite frame to be displayed.
void setIndex(int new_index)
Set index of current Sprite frame to be displayed.
Sprite * m_p_sprite
Sprite associated with Animation.
Definition: Animation.h:20
int draw(Vector position)
Draw single frame centered at position (x,y).
int serialize(std::stringstream *p_ss) const
Serialize attributes to stream.
void setSprite(Sprite *p_new_sprite)
Set associated Sprite to new one.
int getSlowdownCount() const
Set animation slowdown count (-1 means stop animation).
const Sprite * getSprite() const
Return pointer to associated Sprite.
void setName(std::string new_name)
Set Sprite name (in ResourceManager).
std::string getName() const
Get Sprite name (in ResourceManager).
int m_slowdown_count
Slowdown counter (-1 means stop).
Definition: Animation.h:22
int deserialize(std::stringstream *p_ss)
Deserialize attributes from stream.
bool isModified() const
Return true if any attributes modified since last serialize.
bool operator==(const Animation &a)
Compare two Animations.
bool m_modified
True if modified since serialize().
Definition: Animation.h:24
std::string m_name
Sprite name in ResourceManager.
Definition: Animation.h:23
An animation for a sprite.
Definition: Animation.h:15