diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2019-02-24 12:30:40 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2019-02-24 12:30:40 -0500 |
commit | 90b9831d6fb89feedeec63cb392c4535c5df60fe (patch) | |
tree | 78faf1865bc0566454254d072b85f872bbc585ea /src/state.h | |
parent | f264cfd7655a48f7e9a6e2fc5b1c62d6d2036025 (diff) | |
download | dispatcher-90b9831d6fb89feedeec63cb392c4535c5df60fe.tar.gz dispatcher-90b9831d6fb89feedeec63cb392c4535c5df60fe.tar.bz2 dispatcher-90b9831d6fb89feedeec63cb392c4535c5df60fe.zip |
Started state machine
The "--editor" flag can be passed to the program to start it in editor mode, which is currently nothing. The Renderer class was removed here, as each state basically needs to do its own rendering. However, refactoring to make this more elegant will probably occur in the future.
Diffstat (limited to 'src/state.h')
-rw-r--r-- | src/state.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/state.h b/src/state.h new file mode 100644 index 0000000..3c3cfb4 --- /dev/null +++ b/src/state.h | |||
@@ -0,0 +1,19 @@ | |||
1 | #ifndef STATE_H_86BFEF59 | ||
2 | #define STATE_H_86BFEF59 | ||
3 | |||
4 | #include "renderer.h" | ||
5 | |||
6 | class State { | ||
7 | public: | ||
8 | |||
9 | virtual ~State() = default; | ||
10 | |||
11 | virtual void tick( | ||
12 | double dt, | ||
13 | const Uint8* keystate) = 0; | ||
14 | |||
15 | virtual void render(SDL_Renderer* ren) = 0; | ||
16 | |||
17 | }; | ||
18 | |||
19 | #endif /* end of include guard: STATE_H_86BFEF59 */ | ||