1 #ifndef MSP_GAME_SYSTEMSCHEDULER_H_
2 #define MSP_GAME_SYSTEMSCHEDULER_H_
5 #include "mspgame_api.h"
6 #include "reflection.h"
12 class MSPGAME_API scheduling_error: public std::logic_error
15 scheduling_error(const std::string &w): logic_error(w) { }
18 class MSPGAME_API SystemScheduler
23 std::vector<System *> systems;
29 System *system = nullptr;
30 Reflection::ClassBase *type = nullptr;
31 std::vector<GraphNode *> predecessors;
32 unsigned scheduled_order = 0;
35 Reflection::Reflector &reflector;
36 std::vector<GraphNode> nodes;
37 std::vector<Group> groups;
40 SystemScheduler(Reflection::Reflector &);
42 void add_system(System &);
43 void remove_system(System &);
46 static int get_order(const GraphNode &, const GraphNode &);
47 static int get_explicit_order(const GraphNode &, const GraphNode &);
48 static int get_data_order(const GraphNode &, const GraphNode &);
50 const std::vector<Group> &get_groups() const { return groups; }
53 } // namespace Msp::Game