]> git.tdb.fi Git - libs/demoscene.git/blobdiff - source/sequencer.cpp
Use LoadableTypeRegistry to manage action types in Sequencer
[libs/demoscene.git] / source / sequencer.cpp
index b4969bb30337182b35500b7ec378797bd8c1e86c..25182b8ef6ee7f4e623b83cfc942f8fe17339e86 100644 (file)
@@ -189,26 +189,22 @@ Sequencer::ActionDefLoader::ActionDefLoader(Sequencer &s, Demo &d):
        DataFile::ObjectLoader<Sequencer>(s),
        demo(d)
 {
-       for(const auto &t: obj.action_types)
-               add(t.first, t.second->get_def_loader_func());
-}
-
-void Sequencer::ActionDefLoader::finished()
-{
-       if(action)
-               action->validate();
+       obj.action_registry.add_all(*this);
 }
 
 
 Sequencer::SegmentLoader::SegmentLoader(Sequencer &s, float b, float e, Demo &d):
-       ObjectLoader<Sequencer>(s),
+       ActionDefLoader(s, d),
        start_beat(b),
-       end_beat(e),
-       demo(d)
+       end_beat(e)
 {
        add("apply", &SegmentLoader::apply);
-       for(const auto &t: obj.action_types)
-               add(t.first, t.second->get_loader_func());
+}
+
+void Sequencer::SegmentLoader::action_loaded()
+{
+       obj.add_action(*action, start_beat, end_beat);
+       obj.anonymous_actions.push_back(action.release());
 }
 
 void Sequencer::SegmentLoader::apply(const string &n)