- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

# AnimatedSprite Class Reference

`#include <AnimatedSprite.h>`

Inheritance diagram for AnimatedSprite:

List of all members.

## Public Member Functions
| AnimatedSprite (std::string filename, List *spriteInfo)
| AnimatedSprite (AnimatedSprite *sprite)
| ~AnimatedSprite ()
Sprite * | instance ()
virtual void | update ()
virtual void | draw (int x, int y, bool origin=LEVEL)
virtual void | reset ()
virtual void | clean ()
## Protected Attributes
std::vector< Sprite * > | _createdSprites
std::vector< SpriteTime > | _sprites
int | _index
int | _time
int | _totalTime
bool | _loop

## Detailed Description

Definition at line 14 of file AnimatedSprite.h.

## Constructor & Destructor Documentation

AnimatedSprite::AnimatedSprite | ( | std::string | filename,
|  | List * | spriteInfo
| ) |

| Definition at line 17 of file AnimatedSprite.cpp. References Sprite::_filename, List::empty(), List::firstList(), Sprite::loadSprite(), List::rest(), and SpriteTime::s. Referenced by instance().

AnimatedSprite::AnimatedSprite | ( | AnimatedSprite * | sprite | ) |

| Definition at line 62 of file AnimatedSprite.cpp. References _loop, _sprites, and _totalTime.

AnimatedSprite::~AnimatedSprite | ( |  | ) |

| Definition at line 70 of file AnimatedSprite.cpp. References clean().

## Member Function Documentation

void AnimatedSprite::clean | ( |  | ) | `[virtual]`

| Reimplemented from Sprite. Definition at line 75 of file AnimatedSprite.cpp. References _createdSprites. Referenced by ~AnimatedSprite().

void AnimatedSprite::draw | ( | int | x,
|  | int | y,
|  | bool | origin = `LEVEL`
| ) | `[virtual]`

| Reimplemented from Sprite. Definition at line 101 of file AnimatedSprite.cpp. References Sprite::_box, Sprite::_direction, _index, Sprite::_rect, and _sprites.

Sprite * AnimatedSprite::instance | ( |  | ) | `[virtual]`

| Reimplemented from Sprite. Definition at line 113 of file AnimatedSprite.cpp. References _createdSprites, and AnimatedSprite().

virtual void AnimatedSprite::reset | ( |  | ) | `[inline, virtual]`

| Reimplemented from Sprite. Definition at line 27 of file AnimatedSprite.h. References _index, and _time.

void AnimatedSprite::update | ( |  | ) | `[virtual]`

| Reimplemented from Sprite. Definition at line 82 of file AnimatedSprite.cpp. References _index, _loop, _sprites, _time, and _totalTime.

## Member Data Documentation

std::vector<Sprite*> AnimatedSprite::_createdSprites`[protected]`

| Definition at line 31 of file AnimatedSprite.h. Referenced by clean(), and instance().

int AnimatedSprite::_index`[protected]`

| Definition at line 33 of file AnimatedSprite.h. Referenced by draw(), reset(), and update().

bool AnimatedSprite::_loop`[protected]`

| Definition at line 36 of file AnimatedSprite.h. Referenced by AnimatedSprite(), and update().

std::vector<SpriteTime> AnimatedSprite::_sprites`[protected]`

| Definition at line 32 of file AnimatedSprite.h. Referenced by AnimatedSprite(), draw(), and update().

int AnimatedSprite::_time`[protected]`

| Definition at line 34 of file AnimatedSprite.h. Referenced by reset(), and update().

int AnimatedSprite::_totalTime`[protected]`

| Definition at line 35 of file AnimatedSprite.h. Referenced by AnimatedSprite(), and update().

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

- C:/Documents and Settings/jegan/Desktop/projectX/AnimatedSprite.h
- C:/Documents and Settings/jegan/Desktop/projectX/AnimatedSprite.cpp