1 #ifndef YAPOG_SPRITESET_HXX
2 # define YAPOG_SPRITESET_HXX
11 , currentSprite_ (nullptr)
21 , currentSprite_ (nullptr)
25 AddSprite (it.first, it.second->Clone ());
34 for (
const auto& it : sprites_)
47 bool isEmpty = sprites_.IsEmpty ();
49 sprites_.Add (key, sprite);
62 if (currentKey_ == key)
65 sprites_.Remove (key);
71 if (!sprites_.Contains (key))
75 currentSprite_ = sprites_[currentKey_];
87 SetCurrentSprite (defaultKey_);
93 return currentSprite_->GetSize ();
99 for (
auto& it : sprites_)
100 it.second->Move (offset);
103 template <
typename K>
106 for (
auto& it : sprites_)
107 it.second->Scale (factor);
110 template <
typename K>
113 currentSprite_->Draw (context);
116 template <
typename K>
121 template <
typename K>
124 for (
auto& it : sprites_)
125 it.second->ChangeColor (color);
128 template <
typename K>
131 currentSprite_->Update (dt);
135 #endif // YAPOG_SPRITESET_HXX