aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/animations/je_animator.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-16 00:24:51 +0800
committerchai <chaifix@163.com>2018-11-16 00:24:51 +0800
commit831e814ce9bdb84e86c06c4a52008f6bdaaa00d6 (patch)
treef91fccc7d2628d6e0a39886134b2bb174f5eede4 /src/libjin/Graphics/animations/je_animator.h
parent6dc75930fe5fe02f1af5489917752d315cf9e48f (diff)
*合并master到minimal分支
Diffstat (limited to 'src/libjin/Graphics/animations/je_animator.h')
-rw-r--r--src/libjin/Graphics/animations/je_animator.h50
1 files changed, 50 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..6510a7d
--- /dev/null
+++ b/src/libjin/Graphics/animations/je_animator.h
@@ -0,0 +1,50 @@
+#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 switchAnimation(const std::string& key);
+
+ ///
+ /// 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 Animations
+ } // namespace Graphics
+} // namespace JinEngine
+
+#endif \ No newline at end of file