| 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 | @ingroup Management CoreGame |
|---|
| 32 | @brief |
|---|
| 33 | Declaration of Game Singleton which is responsible for running the game. |
|---|
| 34 | */ |
|---|
| 35 | |
|---|
| 36 | #ifndef _Game_H__ |
|---|
| 37 | #define _Game_H__ |
|---|
| 38 | |
|---|
| 39 | #include "CorePrereqs.h" |
|---|
| 40 | |
|---|
| 41 | #include <string> |
|---|
| 42 | #include <QScopedPointer> |
|---|
| 43 | #include "util/Singleton.h" |
|---|
| 44 | |
|---|
| 45 | namespace orxonox |
|---|
| 46 | { |
|---|
| 47 | /** |
|---|
| 48 | @brief |
|---|
| 49 | Main class responsible for running the game. |
|---|
| 50 | @remark |
|---|
| 51 | You should only create this singleton once because it owns the Core class! (see remark there) |
|---|
| 52 | */ |
|---|
| 53 | class _CoreExport Game : public Singleton<Game> |
|---|
| 54 | { |
|---|
| 55 | friend class Singleton<Game>; |
|---|
| 56 | |
|---|
| 57 | public: |
|---|
| 58 | Game(const std::string& cmdLine); |
|---|
| 59 | ~Game(); |
|---|
| 60 | |
|---|
| 61 | void setConfigValues(); |
|---|
| 62 | |
|---|
| 63 | void run(); |
|---|
| 64 | void stop(); |
|---|
| 65 | |
|---|
| 66 | private: |
|---|
| 67 | Game(Game&); // don't mess with singletons |
|---|
| 68 | |
|---|
| 69 | QScopedPointer<Core> core_; |
|---|
| 70 | bool bAbort_; |
|---|
| 71 | |
|---|
| 72 | static Game* singletonPtr_s; //!< Pointer to the Singleton |
|---|
| 73 | }; |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | #endif /* _Game_H__ */ |
|---|