aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/animations/je_animator.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-29 08:27:51 +0800
committerchai <chaifix@163.com>2018-10-29 08:27:51 +0800
commitaca962d7ce3d404671cace2a82b04ff937375009 (patch)
treeec315ef9df3dbd971bc914dae689e97cf9cf31ff /src/libjin/Graphics/animations/je_animator.h
parent297c78319e6bd891f27f9546334feedc030fc0a7 (diff)
*修改代码结构
Diffstat (limited to 'src/libjin/Graphics/animations/je_animator.h')
-rw-r--r--src/libjin/Graphics/animations/je_animator.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/libjin/Graphics/animations/je_animator.h b/src/libjin/Graphics/animations/je_animator.h
new file mode 100644
index 0000000..9273ff8
--- /dev/null
+++ b/src/libjin/Graphics/animations/je_animator.h
@@ -0,0 +1,51 @@
+#ifndef __JE_ANIMATOR_H
+#define __JE_ANIMATOR_H
+
+#include <map>
+#include <vector>
+#include <string>
+
+#include "je_animation.h"
+
+namespace JinEngine
+{
+ namespace Graphics
+ {
+ namespace Animations
+ {
+
+ ///
+ ///
+ ///
+ class Animator
+ {
+ public:
+ void addAnimation(const std::string& key, Animation* clip);
+ bool hasKey(const std::string& key);
+
+ void play();
+ void switchAnimationByKey(const std::string& key);
+ void switchAnimation(const Animation* clip);
+
+ ///
+ /// Control clips.
+ ///
+ void stopAnimation();
+ void pauseAnimation();
+ void rewindAnimation();
+ void startAnimation();
+
+ private:
+ ///
+ /// Map a key to clips.
+ ///
+ std::map<std::string, Animation*> mAnimations;
+ Animation* mCurrentAnimation;
+
+ };
+
+ }
+ } // namespace Graphics
+} // namespace JinEngine
+
+#endif \ No newline at end of file