git repos / blockattack-game

blame: source/code/sago/GameStateInterface.hpp

normal view · raw

c3b697c6 sago007 2016-02-07 17:30 1
/*
c3b697c6 sago007 2016-02-07 17:30 2
 * To change this license header, choose License Headers in Project Properties.
c3b697c6 sago007 2016-02-07 17:30 3
 * To change this template file, choose Tools | Templates
c3b697c6 sago007 2016-02-07 17:30 4
 * and open the template in the editor.
c3b697c6 sago007 2016-02-07 17:30 5
 */
c3b697c6 sago007 2016-02-07 17:30 6
c3b697c6 sago007 2016-02-07 17:30 7
/* 
c3b697c6 sago007 2016-02-07 17:30 8
 * File:   GameStateInterface.hpp
c3b697c6 sago007 2016-02-07 17:30 9
 * Author: poul
c3b697c6 sago007 2016-02-07 17:30 10
 *
c3b697c6 sago007 2016-02-07 17:30 11
 * Created on 7. februar 2016, 17:26
c3b697c6 sago007 2016-02-07 17:30 12
 */
c3b697c6 sago007 2016-02-07 17:30 13
c3b697c6 sago007 2016-02-07 17:30 14
#ifndef GAMESTATEINTERFACE_HPP
c3b697c6 sago007 2016-02-07 17:30 15
#define GAMESTATEINTERFACE_HPP
c3b697c6 sago007 2016-02-07 17:30 16
c3b697c6 sago007 2016-02-07 17:30 17
#include "SDL.h"
c3b697c6 sago007 2016-02-07 17:30 18
c3b697c6 sago007 2016-02-07 17:30 19
namespace sago {
c3b697c6 sago007 2016-02-07 17:30 20
c3b697c6 sago007 2016-02-07 17:30 21
class GameStateInterface {
c3b697c6 sago007 2016-02-07 17:30 22
public:
c3b697c6 sago007 2016-02-07 17:30 23
	/**
c3b697c6 sago007 2016-02-07 17:30 24
	 * Is the state active. If this returns false then the State-manager will pop the state object
c3b697c6 sago007 2016-02-07 17:30 25
	 * @return true if active
c3b697c6 sago007 2016-02-07 17:30 26
	 */
c3b697c6 sago007 2016-02-07 17:30 27
	virtual bool IsActive() = 0;
c3b697c6 sago007 2016-02-07 17:30 28
	
c3b697c6 sago007 2016-02-07 17:30 29
	/**
c3b697c6 sago007 2016-02-07 17:30 30
	 * Tells the state to draw itself to target
c3b697c6 sago007 2016-02-07 17:30 31
	 * @param target The RenderWindow to draw to
c3b697c6 sago007 2016-02-07 17:30 32
	 */
c3b697c6 sago007 2016-02-07 17:30 33
	virtual void Draw(SDL_Renderer* target) = 0;
c3b697c6 sago007 2016-02-07 17:30 34
	
c3b697c6 sago007 2016-02-07 17:30 35
	virtual void ProcessInput(const SDL_Event& event, bool &processed) = 0;
c3b697c6 sago007 2016-02-07 17:30 36
	
c3b697c6 sago007 2016-02-07 17:30 37
	virtual void Update() {}
c3b697c6 sago007 2016-02-07 17:30 38
};
c3b697c6 sago007 2016-02-07 17:30 39
c3b697c6 sago007 2016-02-07 17:30 40
}  //sago
c3b697c6 sago007 2016-02-07 17:30 41
c3b697c6 sago007 2016-02-07 17:30 42
#endif /* GAMESTATEINTERFACE_HPP */
c3b697c6 sago007 2016-02-07 17:30 43
1970-01-01 00:00 44