]> git.localhorst.tv Git - blank.git/blob - src/app/Runtime.hpp
move RandomWalk into new "ai" module
[blank.git] / src / app / Runtime.hpp
1 #ifndef BLANK_RUNTIME_HPP_
2 #define BLANK_RUNTIME_HPP_
3
4 #include "Application.hpp"
5
6 #include <cstddef>
7
8
9 namespace blank {
10
11 /// Parse and interpret arguemnts, then set up the environment and execute.
12 class Runtime {
13
14 public:
15         enum Mode {
16                 /// default behaviour: run until user quits, dynamic timesteps
17                 NORMAL,
18                 /// quit after n frames
19                 FRAME_LIMIT,
20                 /// quit after n milliseconds
21                 TIME_LIMIT,
22                 /// quit after n frames, use fixed timestap
23                 FIXED_FRAME_LIMIT,
24                 /// display error message and quit with failure
25                 ERROR,
26         };
27
28         Runtime() noexcept;
29
30         void ReadArgs(int argc, const char *const *argv);
31
32         int Execute();
33
34 private:
35         const char *name;
36         Mode mode;
37         std::size_t n;
38         std::size_t t;
39         Application::Config config;
40
41 };
42
43 }
44
45 #endif