]> git.tdb.fi Git - libs/demoscene.git/blobdiff - source/action.h
Allow stages to define actions
[libs/demoscene.git] / source / action.h
index 980b038a27b4469cd74ff49b5df0153ace8b70b5..dacf788fa31597d4864249ae038f5a60f5132ea9 100644 (file)
@@ -1,13 +1,31 @@
 #ifndef MSP_DEMOSCENE_ACTION_H_
 #define MSP_DEMOSCENE_ACTION_H_
 
+#include <msp/datafile/objectloader.h>
+
+namespace Msp {
+namespace DemoScene {
+
+class Demo;
+
 class Action
 {
+public:
+       class Loader: public Msp::DataFile::ObjectLoader<Action>
+       {
+       protected:
+               Demo &demo;
+
+               Loader(Action &, Demo &);
+       };
+
 protected:
        Action() { }
 public:
        virtual ~Action() { }
 
+       virtual void validate() const = 0;
+
        virtual void start(float, float) { }
        virtual void beat(int) { }
        virtual void tick(float, float) { }
@@ -36,4 +54,7 @@ public:
        virtual void interpolate(float, float) { }
 };
 
+} // namespace DemoScene
+} // namespace Msp
+
 #endif