YAPOG  0.0.1
Yet Another Pokemon Online Game
yap::AnimatedSprite Class Reference

An ISprite that automatically evolves over time, playing predetertmined ISprite. More...

#include <AnimatedSprite.hpp>

Inheritance diagram for yap::AnimatedSprite:
Collaboration diagram for yap::AnimatedSprite:

List of all members.

Public Types

enum  PlayState { None = 0, Once = 1, Loop = 2 }
typedef collection::Array
< ISprite * >::SizeType 
IndexType

Public Member Functions

virtual ~AnimatedSprite ()
void AddFrame (ISprite *sprite)
void RemoveFrame (ISprite *sprite)
void ChangeState (PlayState playState)
void SetDefaultFrame (IndexType index)
- Public Member Functions inherited from yap::BaseSprite
 BaseSprite ()
virtual ~BaseSprite ()
virtual const Vector2GetPosition () const
 Gets the coordinates in pixels of the origin of this ISpatial from the global origin.
virtual const Vector2GetSize () const
 Gets the size in pixels of this ISpatial.
virtual const Vector2GetTopLeft () const
virtual const Vector2GetBottomRight () const
virtual const Vector2GetCenter () const
virtual const FloatRectGetRectangle () const
virtual void Move (const Vector2 &offset)
virtual void Scale (const Vector2 &factor)
virtual void SetPosition (const Vector2 &position)
virtual void SetSize (const Vector2 &size)
virtual void Draw (IDrawingContext &context)
virtual bool IsVisible () const
virtual void Show (bool isVisible)
virtual void ChangeColor (const sf::Color &color)
virtual void Update (const Time &dt)
 Makes the object evolve for one frame of the game.
- Public Member Functions inherited from yap::ISprite
virtual ~ISprite ()
virtual ISpriteClone () const
- Public Member Functions inherited from yap::ISpatial
virtual ~ISpatial ()
- Public Member Functions inherited from yap::IDrawable
virtual ~IDrawable ()
- Public Member Functions inherited from yap::IUpdateable
virtual ~IUpdateable ()
- Public Member Functions inherited from yap::ILoadable
virtual ~ILoadable ()
- Public Member Functions inherited from yap::ICloneable
virtual ~ICloneable ()

Protected Member Functions

 AnimatedSprite ()
 AnimatedSprite (const AnimatedSprite &copy)
void SetFrameSwitcher (FrameSwitcher *frameSwitcher)
virtual Vector2 HandleGetSize () const
virtual void HandleMove (const Vector2 &offset)
virtual void HandleScale (const Vector2 &factor)
virtual void HandleDraw (IDrawingContext &context)
virtual void HandleShow (bool isVisible)
virtual void HandleChangeColor (const sf::Color &color)
virtual void HandleUpdate (const Time &dt)
- Protected Member Functions inherited from yap::BaseSprite
 BaseSprite (const BaseSprite &copy)

Private Member Functions

 DISALLOW_ASSIGN (AnimatedSprite)
void SetCurrentFrame (IndexType index)
void SetDefaultFrame ()

Private Attributes

collection::Array< ISprite * > sprites_
FrameSwitcherframeSwitcher_
PlayState currentState_
IndexType currentIndex_
ISpritecurrentFrame_
IndexType defaultIndex_

Static Private Attributes

static const PlayState DEFAULT_PLAY_STATE
static const IndexType DEFAULT_DEFAULT_INDEX = 0

Detailed Description

An ISprite that automatically evolves over time, playing predetertmined ISprite.

Definition at line 14 of file AnimatedSprite.hpp.


Member Typedef Documentation

Definition at line 27 of file AnimatedSprite.hpp.


Member Enumeration Documentation

Enumerator:
None 
Once 
Loop 

Definition at line 20 of file AnimatedSprite.hpp.


Constructor & Destructor Documentation

yap::AnimatedSprite::~AnimatedSprite ( )
virtual

Definition at line 21 of file AnimatedSprite.cpp.

yap::AnimatedSprite::AnimatedSprite ( )
protected

Definition at line 10 of file AnimatedSprite.cpp.

yap::AnimatedSprite::AnimatedSprite ( const AnimatedSprite copy)
protected

Definition at line 30 of file AnimatedSprite.cpp.

Here is the call graph for this function:


Member Function Documentation

void yap::AnimatedSprite::AddFrame ( ISprite sprite)

Definition at line 46 of file AnimatedSprite.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::AnimatedSprite::ChangeState ( PlayState  playState)

Definition at line 56 of file AnimatedSprite.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

yap::AnimatedSprite::DISALLOW_ASSIGN ( AnimatedSprite  )
private
void yap::AnimatedSprite::HandleChangeColor ( const sf::Color &  color)
protectedvirtual

Implements yap::BaseSprite.

Definition at line 114 of file AnimatedSprite.cpp.

void yap::AnimatedSprite::HandleDraw ( IDrawingContext context)
protectedvirtual

Implements yap::BaseSprite.

Definition at line 102 of file AnimatedSprite.cpp.

Here is the call graph for this function:

Vector2 yap::AnimatedSprite::HandleGetSize ( ) const
protectedvirtual

Reimplemented from yap::BaseSprite.

Definition at line 85 of file AnimatedSprite.cpp.

Here is the call graph for this function:

void yap::AnimatedSprite::HandleMove ( const Vector2 offset)
protectedvirtual

Implements yap::BaseSprite.

Definition at line 90 of file AnimatedSprite.cpp.

void yap::AnimatedSprite::HandleScale ( const Vector2 factor)
protectedvirtual

Implements yap::BaseSprite.

Definition at line 96 of file AnimatedSprite.cpp.

void yap::AnimatedSprite::HandleShow ( bool  isVisible)
protectedvirtual

Implements yap::BaseSprite.

Definition at line 110 of file AnimatedSprite.cpp.

void yap::AnimatedSprite::HandleUpdate ( const Time dt)
protectedvirtual

Implements yap::BaseSprite.

Definition at line 120 of file AnimatedSprite.cpp.

Here is the call graph for this function:

void yap::AnimatedSprite::RemoveFrame ( ISprite sprite)

Definition at line 51 of file AnimatedSprite.cpp.

Here is the call graph for this function:

void yap::AnimatedSprite::SetCurrentFrame ( IndexType  index)
private

Definition at line 74 of file AnimatedSprite.cpp.

Here is the caller graph for this function:

void yap::AnimatedSprite::SetDefaultFrame ( IndexType  index)

Definition at line 64 of file AnimatedSprite.cpp.

void yap::AnimatedSprite::SetDefaultFrame ( )
private

Definition at line 80 of file AnimatedSprite.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::AnimatedSprite::SetFrameSwitcher ( FrameSwitcher frameSwitcher)
protected

Definition at line 69 of file AnimatedSprite.cpp.

Here is the caller graph for this function:


Member Data Documentation

ISprite* yap::AnimatedSprite::currentFrame_
private

Definition at line 69 of file AnimatedSprite.hpp.

IndexType yap::AnimatedSprite::currentIndex_
private

Definition at line 68 of file AnimatedSprite.hpp.

PlayState yap::AnimatedSprite::currentState_
private

Definition at line 67 of file AnimatedSprite.hpp.

const AnimatedSprite::IndexType yap::AnimatedSprite::DEFAULT_DEFAULT_INDEX = 0
staticprivate

Definition at line 63 of file AnimatedSprite.hpp.

const AnimatedSprite::PlayState yap::AnimatedSprite::DEFAULT_PLAY_STATE
staticprivate
Initial value:
PlayState::Loop

Definition at line 62 of file AnimatedSprite.hpp.

IndexType yap::AnimatedSprite::defaultIndex_
private

Definition at line 70 of file AnimatedSprite.hpp.

FrameSwitcher* yap::AnimatedSprite::frameSwitcher_
private

Definition at line 66 of file AnimatedSprite.hpp.

collection::Array<ISprite*> yap::AnimatedSprite::sprites_
private

Definition at line 65 of file AnimatedSprite.hpp.


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