SpriteDef Class Reference

#include <spritedef.h>

Inheritance diagram for SpriteDef:

Resource

List of all members.


Detailed Description

Defines a class to load an animation.

Definition at line 78 of file spritedef.h.


Public Member Functions

ActiongetAction (SpriteAction action) const
 Returns the specified action.

Static Public Member Functions

static SpriteDefload (const std::string &file, int variant)
 Loads a sprite definition file.
static SpriteAction makeSpriteAction (const std::string &action)
 Converts a string into a SpriteAction enum.
static SpriteDirection makeSpriteDirection (const std::string &direction)
 Converts a string into a SpriteDirection enum.

Private Types

typedef std::map< std::string,
ImageSet * > 
ImageSets
typedef ImageSets::iterator ImageSetIterator
typedef std::map< SpriteAction,
Action * > 
Actions

Private Member Functions

 SpriteDef ()
 Constructor.
 ~SpriteDef ()
 Destructor.
void loadSprite (xmlNodePtr spriteNode, int variant, const std::string &palettes="")
 Loads a sprite element.
void loadImageSet (xmlNodePtr node, const std::string &palettes)
 Loads an imageset element.
void loadAction (xmlNodePtr node, int variant_offset)
 Loads an action element.
void loadAnimation (xmlNodePtr animationNode, Action *action, ImageSet *imageSet, int variant_offset)
 Loads an animation element.
void includeSprite (xmlNodePtr includeNode)
 Include another sprite into this one.
void substituteActions ()
 Complete missing actions by copying existing ones.
void substituteAction (SpriteAction complete, SpriteAction with)
 When there are no animations defined for the action "complete", its animations become a copy of those of the action "with".

Private Attributes

ImageSets mImageSets
Actions mActions

Member Typedef Documentation

typedef std::map<std::string, ImageSet*> SpriteDef::ImageSets [private]

Definition at line 152 of file spritedef.h.

typedef ImageSets::iterator SpriteDef::ImageSetIterator [private]

Definition at line 153 of file spritedef.h.

typedef std::map<SpriteAction, Action*> SpriteDef::Actions [private]

Definition at line 155 of file spritedef.h.


Constructor & Destructor Documentation

SpriteDef::SpriteDef (  )  [inline, private]

Constructor.

Definition at line 106 of file spritedef.h.

SpriteDef::~SpriteDef (  )  [private]

Destructor.

Definition at line 301 of file spritedef.cpp.


Member Function Documentation

SpriteDef * SpriteDef::load ( const std::string &  file,
int  variant 
) [static]

Loads a sprite definition file.

Definition at line 50 of file spritedef.cpp.

Action * SpriteDef::getAction ( SpriteAction  action  )  const

Returns the specified action.

Definition at line 37 of file spritedef.cpp.

SpriteAction SpriteDef::makeSpriteAction ( const std::string &  action  )  [static]

Converts a string into a SpriteAction enum.

Definition at line 324 of file spritedef.cpp.

SpriteDirection SpriteDef::makeSpriteDirection ( const std::string &  direction  )  [static]

Converts a string into a SpriteDirection enum.

Definition at line 406 of file spritedef.cpp.

void SpriteDef::loadSprite ( xmlNodePtr  spriteNode,
int  variant,
const std::string &  palettes = "" 
) [private]

Loads a sprite element.

Definition at line 95 of file spritedef.cpp.

void SpriteDef::loadImageSet ( xmlNodePtr  node,
const std::string &  palettes 
) [private]

Loads an imageset element.

Definition at line 125 of file spritedef.cpp.

void SpriteDef::loadAction ( xmlNodePtr  node,
int  variant_offset 
) [private]

Loads an action element.

Definition at line 150 of file spritedef.cpp.

void SpriteDef::loadAnimation ( xmlNodePtr  animationNode,
Action action,
ImageSet imageSet,
int  variant_offset 
) [private]

Loads an animation element.

Definition at line 190 of file spritedef.cpp.

void SpriteDef::includeSprite ( xmlNodePtr  includeNode  )  [private]

Include another sprite into this one.

Definition at line 269 of file spritedef.cpp.

void SpriteDef::substituteActions (  )  [private]

Complete missing actions by copying existing ones.

Definition at line 77 of file spritedef.cpp.

void SpriteDef::substituteAction ( SpriteAction  complete,
SpriteAction  with 
) [private]

When there are no animations defined for the action "complete", its animations become a copy of those of the action "with".

Definition at line 290 of file spritedef.cpp.


Member Data Documentation

Definition at line 157 of file spritedef.h.

Definition at line 158 of file spritedef.h.


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

Generated on Sun Apr 26 17:30:44 2009 for The Mana World by  doxygen 1.5.5