Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/gui/src/orxonox/Game.h @ 2805

Last change on this file since 2805 was 2805, checked in by rgrieder, 15 years ago

Added new class: Game
It represents basic operation related to the running game like start and stop or managing the new GameStates.
And since only three lines were left in Main.cc I thought I could move that to the very beginning of 'Game'.

  • Property svn:eol-style set to native
File size: 1.6 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Reto Grieder
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30@file
31@brief
32    Declaration of Game Singleton.
33 */
34
35#ifndef _Game_H__
36#define _Game_H__
37
38#include "OrxonoxPrereqs.h"
39#include <cassert>
40#include "core/CorePrereqs.h"
41
42namespace orxonox
43{
44    /**
45    @brief
46        Main class responsible for running the game.
47    */
48    class _OrxonoxExport Game
49    {
50    public:
51        Game(int argc, char** argv);
52        ~Game();
53
54        void run();
55        void stop();
56
57        static Game& getInstance() { assert(singletonRef_s); return *singletonRef_s; }
58
59    private:
60        Game(Game&); // don't mess with singletons
61
62        Core* core_;
63
64        bool abort_;
65
66        static Game* singletonRef_s;        //!< Pointer to the Singleton
67    };
68}
69
70#endif /* _Game_H__ */
Note: See TracBrowser for help on using the repository browser.