zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Game.hxx
Go to the documentation of this file.
1 /* This file is part of the Zenipex Library (zenilib).
2  * Copyright (C) 2011 Mitchell Keith Bloch (bazald).
3  *
4  * zenilib is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * zenilib is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with zenilib. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef ZENI_GAME_HXX
19 #define ZENI_GAME_HXX
20 
21 #include <Zeni/Console_State.h>
22 
23 // HXXed below
24 #include <Zeni/Gamestate.h>
25 
26 #include <Zeni/Game.h>
27 
28 namespace Zeni {
29 
31  if(m_states.empty())
32  throw Zero_Gamestate();
33 
34  return m_states.top();
35  }
36 
37  size_t Game::size() const {
38  return m_states.size();
39  }
40 
41  size_t Game::get_fps() const {
42  return fps;
43  }
44 
45 }
46 
47 #include <Zeni/Gamestate.hxx>
48 
49 #endif
size_t get_fps() const
Get the current approximation of the frames displayed per second.
Definition: Game.hxx:41
A smartpointer for a Gamestate_Base.
Definition: Gamestate.h:169
size_t size() const
Get the current size of the Gamestate stack.
Definition: Game.hxx:37
Gamestate get_top()
Get a reference to the current Gamestate.
Definition: Game.hxx:30