Tinman  1.0
state.h
Go to the documentation of this file.
1 // -*- coding:utf-8; tab-width:4; mode:cpp -*-
2 // Tinman author: Isaac Lacoba Molina
3 // Copyright (C) 2014 ISAAC LACOBA MOLINA
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 #ifndef STATE_HPP
19 #define STATE_HPP
20 #include <memory>
21 
22 #include "scene.h"
23 #include "input.h"
24 #include "gui.h"
25 
26 class Game;
27 
28 class State {
29  protected:
30  std::shared_ptr<Game> game_;
31 
32 public:
33  typedef std::shared_ptr<State> shared;
34 
35  State(std::shared_ptr<Game> game);
36  virtual ~State();
37 
38  virtual void enter() = 0;
39  virtual void update(float delta) = 0;
40 };
41 
42 #endif
std::shared_ptr< State > shared
Definition: state.h:33
virtual void update(float delta)=0
State(std::shared_ptr< Game > game)
Definition: state.cpp:20
virtual void enter()=0
Definition: game.h:36
Definition: state.h:28
virtual ~State()
Definition: state.cpp:23
std::shared_ptr< Game > game_
Definition: state.h:30