Created Copy constructor for TweenSets (for reuse). Prepare for component copy constructor.

This commit is contained in:
emb 2015-02-16 12:49:23 -06:00
parent c74ddfb582
commit 6c4dfcb9af
3 changed files with 24 additions and 9 deletions

View File

@ -19,6 +19,21 @@
TweenSets::TweenSets()
{
}
TweenSets::TweenSets(TweenSets &copy)
{
std::map<std::string, std::map<int, TweenAttributes *> >::iterator it;
for(it = copy.TweenMap.begin(); it != copy.TweenMap.end(); it++)
{
std::map<int, TweenAttributes *>::iterator it2;
for(it2 = (it->second).begin(); it2 != (it->second).end(); it2++)
{
TweenMap[it->first][it2->first] = it2->second;
}
}
}
TweenSets::~TweenSets()
{

View File

@ -24,6 +24,7 @@ class TweenSets
{
public:
TweenSets();
TweenSets(TweenSets &copy);
~TweenSets();
typedef std::vector<std::vector<Tween *> *> TweenAttributes;

View File

@ -56,7 +56,6 @@ public:
void SetScrollActive(bool scrollActive);
protected:
std::string CollectionName;
Item *GetSelectedItem();
enum AnimationState
{
@ -84,20 +83,20 @@ protected:
bool HighlightExitComplete;
bool NewItemSelectedSinceEnter;
private:
bool Animate(bool loop);
bool IsTweenSequencingComplete();
void ResetTweenSequence(std::vector<ViewInfo *> *tweens);
TweenSets *Tweens;
TweenSets::TweenAttributes *CurrentTweens;
unsigned int CurrentTweenIndex;
bool CurrentTweenComplete;
ViewInfo BaseViewInfo;
float ElapsedTweenTime;
Tween *TweenInst;
Item *SelectedItem;
bool ScrollActive;
SDL_Texture *BackgroundTexture;
unsigned int CurrentTweenIndex;
bool CurrentTweenComplete;
std::string CollectionName;
ViewInfo BaseViewInfo;
float ElapsedTweenTime;
bool ScrollActive;
};