CAnimationPool Class Reference

Singleton used to store animation data. More...

#include <animationPool.h>

List of all members.

Add methods

static int add_group (const std::string &strGroup, const std::string &strAnim, const unit fDist, const bool bCycle=true, const bool bTick=false)
 Add an animation group to the pool.
static int add (const int iGroup, const CFlagSet< CGameEntity::eState > &bsConditions, const std::string &strAnim, const unit fDist, const bool bCycle, const bool bTick=false)
 Add an animation to a group in the pool.
int add_group (const std::string &strGroup, CAnimation &defaultAnim)
 Add an animation group to the pool.
bool add (const int iGroup, CAnimation &anim)
 Add an animation to a group in the pool.

Get methods

static const CAnimationget (const CGameEntity *pGE, const int iGroup=0)
 Get animation values using the key.
static int get_index (const std::string &name)
const CAnimationget_anim (const CGameEntity *pGE, const int iGroup=0)
 Get animation values using the key.

Static Public Member Functions

Load/Reload methods
static bool load (CXMLNode node)
 Load animation descriptions from an XML node.
static bool load (const std::string &filepath)
 Load animation descriptions from a file.
static bool load (const std::string &filename, const std::string &path)
 Load animation descriptions from a file.
static bool reload (CXMLNode node)
 Dump the old pool and reload animation descriptions from a file.
static void clear ()
 Clear out the entire pool.
Info methods
static int size ()
 
Returns:
The number of groups


Static Public Attributes

static const char * m_kStrElmAnimationPool = "AnimationPool"
 XML element strings.

Static Protected Member Functions

static CAnimationPoolinstance ()
 only static methods have access to this class


Detailed Description

Singleton used to store animation data.

(c) 2007-2008 oP group Germany GbR. All rights reserved.
This source code is provided "as is" with no warranty and must not be distributed without written permission.

Author:
Doug Poston
Version:
1.3
Date:
12/28/2007

Member Function Documentation

bool CAnimationPool::load ( CXMLNode  node  )  [static]

Load animation descriptions from an XML node.

Parameters:
node XML node
Returns:
true if the load succeeds

bad group

bool CAnimationPool::load ( const std::string &  filepath  )  [static]

Load animation descriptions from a file.

Parameters:
filepath Full path of the XML file containing the Animation node.
Returns:
true if the load succeeds

bool CAnimationPool::load ( const std::string &  filename,
const std::string &  path 
) [static]

Load animation descriptions from a file.

Parameters:
filename Name of the XML file containing the Animation node.
path Path containing the XML file.
Returns:
true if the load succeeds

bool CAnimationPool::reload ( CXMLNode  node  )  [static]

Dump the old pool and reload animation descriptions from a file.

Parameters:
node XML node
Returns:
true if the load succeeds

int CAnimationPool::add_group ( const std::string &  strGroup,
const std::string &  strAnim,
const unit  fDist,
const bool  bCycle = true,
const bool  bTick = false 
) [static]

Add an animation group to the pool.

Parameters:
strGroup Name of the group
strAnim Name of the default animation
fDist Distance (quants) or time (ticks) of the default animation
bCycle Dose the default animation cycle (loop)?
bTick True if time based, otherwise depends on passed in value (normally distance).
Returns:
index to animation group (neg number on error)

int CAnimationPool::add_group ( const std::string &  strGroup,
CAnimation defaultAnim 
)

Add an animation group to the pool.

Parameters:
strGroup Name of the group
defaultAnim CAnimation struct that contains the default animation
Returns:
index to animation group (neg number on error)

int CAnimationPool::add ( const int  iGroup,
const CFlagSet< CGameEntity::eState > &  bsConditions,
const std::string &  strAnim,
const unit  fDist,
const bool  bCycle,
const bool  bTick = false 
) [static]

Add an animation to a group in the pool.

Parameters:
iGroup Which group we are adding to
bsConditions Conditions that must be passed to select this animation
strAnim Name of the animation
fDist Distance (quants) or time (ticks) in a full animation
bCycle Dose this animation cycle (loop)?
bTick Dose this animation use ticks to animate?
Returns:
key if added (neg number on error)

bool CAnimationPool::add ( const int  iGroup,
CAnimation anim 
)

Add an animation to a group in the pool.

Parameters:
iGroup Which group we are adding to
anim CAnimation struct we are adding
Returns:
True if added, otherwise false

const CAnimation * CAnimationPool::get ( const CGameEntity pGE,
const int  iGroup = 0 
) [static]

Get animation values using the key.

Parameters:
pGE Pointer to the game entity
iGroup Which group we are looking in
Returns:
pointer to the animation struct, 0 if none found

const CAnimation * CAnimationPool::get_anim ( const CGameEntity pGE,
const int  iGroup = 0 
)

Get animation values using the key.

Parameters:
pGE Pointer to the game entity
iGroup Which group we are looking in
Returns:
pointer to the animation struct, 0 if none found

int CAnimationPool::get_index ( const std::string &  name  )  [static]

Parameters:
name String containing the name of the group we want the index to
Returns:
The index for the animation group name (neg if not found)


The documentation for this class was generated from the following files:
Generated on Fri Dec 28 12:55:07 2007 for template7 by  doxygen 1.5.4