| 1 | /* |
| 2 | Copyright (c) 2016 Poul Sander |
| 3 | |
| 4 | Permission is hereby granted, free of charge, to any person |
| 5 | obtaining a copy of this software and associated documentation files |
| 6 | (the "Software"), to deal in the Software without restriction, |
| 7 | including without limitation the rights to use, copy, modify, merge, |
| 8 | publish, distribute, sublicense, and/or sell copies of the Software, |
| 9 | and to permit persons to whom the Software is furnished to do so, |
| 10 | subject to the following conditions: |
| 11 | |
| 12 | The above copyright notice and this permission notice shall be |
| 13 | included in all copies or substantial portions of the Software. |
| 14 | |
| 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 17 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 19 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 20 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | SOFTWARE. |
| 23 | */ |
| 24 | |
| 25 | #ifndef GAMESTATEINTERFACE_HPP |
| 26 | #define GAMESTATEINTERFACE_HPP |
| 27 | |
| 28 | #include "SDL.h" |
| 29 | |
| 30 | namespace sago { |
| 31 | |
| 32 | class GameStateInterface { |
| 33 | public: |
| 34 | /** |
| 35 | * Is the state active. If this returns false then the State-manager will pop the state object |
| 36 | * @return true if active |
| 37 | */ |
| 38 | virtual bool IsActive() = 0; |
| 39 | |
| 40 | /** |
| 41 | * Tells the state to draw itself to target |
| 42 | * @param target The RenderWindow to draw to |
| 43 | */ |
| 44 | virtual void Draw(SDL_Renderer* target) = 0; |
| 45 | |
| 46 | virtual void ProcessInput(const SDL_Event& event, bool& processed) = 0; |
| 47 | |
| 48 | virtual void Update() {} |
| 49 | |
| 50 | virtual ~GameStateInterface() {} |
| 51 | }; |
| 52 | |
| 53 | } //sago |
| 54 | |
| 55 | #endif /* GAMESTATEINTERFACE_HPP */ |
| 56 |