YAPOG
0.0.1
Yet Another Pokemon Online Game
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
ComposedSprite.cpp
Go to the documentation of this file.
1
#include "
YAPOG/Graphics/Game/Sprite/ComposedSprite.hpp
"
2
3
namespace
yap
4
{
5
ComposedSprite::ComposedSprite
()
6
:
BaseSprite
()
7
, sprites_ ()
8
{
9
}
10
11
ComposedSprite::~ComposedSprite
()
12
{
13
for
(
const
auto
& it :
sprites_
)
14
delete
it;
15
}
16
17
void
ComposedSprite::Init
()
18
{
19
UpdatePosition
();
20
}
21
22
void
ComposedSprite::AddSprite
(
ISprite
* sprite)
23
{
24
sprites_
.
Add
(sprite);
25
}
26
27
ISprite
&
ComposedSprite::GetSprite
(
28
const
collection::Array<ISprite*>::SizeType
& index)
const
29
{
30
return
*
sprites_
[index];
31
}
32
33
void
ComposedSprite::HandleMove
(
const
Vector2
& offset)
34
{
35
for
(
auto
& it :
sprites_
)
36
it->Move (offset);
37
}
38
39
void
ComposedSprite::HandleScale
(
const
Vector2
& factor)
40
{
41
for
(
auto
& it :
sprites_
)
42
it->Scale (factor);
43
44
UpdatePosition
();
45
}
46
47
void
ComposedSprite::HandleDraw
(
IDrawingContext
& context)
48
{
49
for
(
auto
& it :
sprites_
)
50
it->Draw (context);
51
}
52
53
void
ComposedSprite::HandleShow
(
bool
isVisible)
54
{
55
}
56
57
void
ComposedSprite::HandleChangeColor
(
const
sf::Color& color)
58
{
59
for
(
auto
& it :
sprites_
)
60
it->ChangeColor (color);
61
}
62
63
void
ComposedSprite::HandleUpdate
(
const
Time
& dt)
64
{
65
for
(
auto
& it :
sprites_
)
66
it->Update (dt);
67
}
68
}
// namespace yap
YAPOG
src
YAPOG
Graphics
Game
Sprite
ComposedSprite.cpp
Generated on Mon Sep 17 2012 22:24:25 for YAPOG by
1.8.1.1