YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
AnimatedSprite.hpp
Go to the documentation of this file.
1
#ifndef YAPOG_ANIMATEDSPRITE_HPP
2
# define YAPOG_ANIMATEDSPRITE_HPP
3
4
# include "
YAPOG/Macros.hpp
"
5
# include "
YAPOG/Graphics/Game/Sprite/BaseSprite.hpp
"
6
# include "
YAPOG/Collection/Array.hpp
"
7
8
namespace
yap
9
{
10
class
FrameSwitcher;
11
14
class
YAPOG_LIB
AnimatedSprite
:
public
BaseSprite
15
{
16
DISALLOW_ASSIGN
(
AnimatedSprite
);
17
18
public
:
19
20
enum class
PlayState
21
{
22
None = 0,
23
Once = 1,
24
Loop = 2
25
};
26
27
typedef
collection::Array<ISprite*>::SizeType
IndexType
;
28
29
virtual
~
AnimatedSprite
();
30
31
void
AddFrame (
ISprite
* sprite);
32
void
RemoveFrame (
ISprite
* sprite);
33
34
void
ChangeState (
PlayState
playState);
35
36
void
SetDefaultFrame (
IndexType
index);
37
38
protected
:
39
40
AnimatedSprite
();
41
AnimatedSprite
(
const
AnimatedSprite
& copy);
42
43
void
SetFrameSwitcher (
FrameSwitcher
* frameSwitcher);
44
45
virtual
Vector2
HandleGetSize ()
const
;
46
47
virtual
void
HandleMove (
const
Vector2
& offset);
48
virtual
void
HandleScale (
const
Vector2
& factor);
49
50
virtual
void
HandleDraw (
IDrawingContext
& context);
51
52
virtual
void
HandleShow (
bool
isVisible);
53
virtual
void
HandleChangeColor (
const
sf::Color& color);
54
55
virtual
void
HandleUpdate (
const
Time
& dt);
56
57
private
:
58
59
void
SetCurrentFrame (
IndexType
index);
60
void
SetDefaultFrame ();
61
62
static
const
PlayState
DEFAULT_PLAY_STATE
;
63
static
const
IndexType
DEFAULT_DEFAULT_INDEX
;
64
65
collection::Array<ISprite*>
sprites_
;
66
FrameSwitcher
*
frameSwitcher_
;
67
PlayState
currentState_
;
68
IndexType
currentIndex_
;
69
ISprite
*
currentFrame_
;
70
IndexType
defaultIndex_
;
71
};
72
}
// namespace yap
73
74
#endif // YAPOG_ANIMATEDSPRITE_HPP
YAPOG
include
YAPOG
Graphics
Game
Sprite
AnimatedSprite.hpp
Generated on Mon Sep 17 2012 22:24:23 for YAPOG by
1.8.1.1