-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathAnimationManager.h
More file actions
49 lines (37 loc) · 1.49 KB
/
AnimationManager.h
File metadata and controls
49 lines (37 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#ifndef CLASS_ANIMATIONMANAGER
#define CLASS_ANIMATIONMANAGER
#include <nctl/UniquePtr.h>
#include "AnimationGroup.h"
class Sprite;
class Script;
/// The animation manager class
class AnimationManager
{
public:
AnimationManager();
inline AnimationGroup &animGroup() { return *animGroup_; }
inline const AnimationGroup &animGroup() const { return *animGroup_; }
inline nctl::Array<nctl::UniquePtr<IAnimation>> &anims() { return (*animGroup_).anims(); }
inline const nctl::Array<nctl::UniquePtr<IAnimation>> &anims() const { return (*animGroup_).anims(); }
inline IAnimation::State state() const { return animGroup_->state(); }
inline float speedMultiplier() const { return speedMultiplier_; }
inline float &speedMultiplier() { return speedMultiplier_; }
inline void setSpeedMultiplier(float speedMultiplier) { speedMultiplier_ = speedMultiplier; }
inline void stop() { animGroup_->stop(); }
inline void pause() { animGroup_->pause(); }
inline void play() { animGroup_->play(); }
void update(float deltaTime);
void clear();
void removeAnimation(IAnimation *anim);
void removeSprite(Sprite *sprite);
void assignGridAnchorToParameters(Sprite *sprite);
void removeScript(Script *script);
void reloadScript(Script *script);
void initScriptsForSprite(Sprite *sprite);
void overrideSprite(AnimationGroup &animGroup, Sprite *sprite);
void cloneSpriteAnimations(const Sprite *fromSprite, Sprite *toSprite);
private:
float speedMultiplier_;
nctl::UniquePtr<AnimationGroup> animGroup_;
};
#endif