YAPOG  0.0.1
Yet Another Pokemon Online Game
ComposedSprite.cpp
Go to the documentation of this file.
2 
3 namespace yap
4 {
6  : BaseSprite ()
7  , sprites_ ()
8  {
9  }
10 
12  {
13  for (const auto& it : sprites_)
14  delete it;
15  }
16 
18  {
19  UpdatePosition ();
20  }
21 
23  {
24  sprites_.Add (sprite);
25  }
26 
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 
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 
64  {
65  for (auto& it : sprites_)
66  it->Update (dt);
67  }
68 } // namespace yap