]> git.tdb.fi Git - libs/game.git/blobdiff - source/game/system.cpp
Add a way for systems to do things at the end of a tick
[libs/game.git] / source / game / system.cpp
diff --git a/source/game/system.cpp b/source/game/system.cpp
new file mode 100644 (file)
index 0000000..87ba3b6
--- /dev/null
@@ -0,0 +1,12 @@
+#include "system.h"
+
+namespace Msp::Game {
+
+void System::deferred_tick()
+{
+       for(const auto &f: deferred_queue)
+               f();
+       deferred_queue.clear();
+}
+
+} // namespace Msp::Game