1 #ifndef MSP_GAME_SYSTEMSCHEDULER_H_
2 #define MSP_GAME_SYSTEMSCHEDULER_H_
5 #include "reflection.h"
11 class scheduling_error: public std::logic_error
14 scheduling_error(const std::string &w): logic_error(w) { }
22 std::vector<System *> systems;
28 System *system = nullptr;
29 Reflection::ClassBase *type = nullptr;
30 std::vector<GraphNode *> predecessors;
31 unsigned scheduled_order = 0;
34 Reflection::Reflector &reflector;
35 std::vector<GraphNode> nodes;
36 std::vector<Group> groups;
39 SystemScheduler(Reflection::Reflector &);
41 void add_system(System &);
42 void remove_system(System &);
45 static int get_order(const GraphNode &, const GraphNode &);
46 static int get_explicit_order(const GraphNode &, const GraphNode &);
47 static int get_data_order(const GraphNode &, const GraphNode &);
49 const std::vector<Group> &get_groups() const { return groups; }
52 } // namespace Msp::Game