git repos / blockattack-game

blame: source/code/sago/GameStateInterface.hpp

normal view · raw

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