Debian Codegraph @

engine/include/settings.h

raw
1 // ____ _ __
2 // / __ )____ _____ | | / /___ ___________
3 // / __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
4 // / /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
5 // /_____/\____/____/ |__/|__/\__,_/_/ /____/
6 //
7 // A futuristic real-time strategy game.
8 // This file is part of Bos Wars.
9 //
10 /**@name settings.h - The game settings headerfile. */
11 //
12 // (c) Copyright 2000-2009 by Andreas Arens and Jimmy Salmon
13 //
14 // This program is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; only version 2 of the License.
17 //
18 // This program is distributed in the hope that it will be useful,
19 // but WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program; if not, write to the Free Software
25 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
26 // 02111-1307, USA.
27
28 #ifndef __SETTINGS_H__
29 #define __SETTINGS_H__
30
31 //@{
32
33 #include <vector>
34 #include "player.h"
35
36 class CFile;
37 class CMap;
38
39 struct SettingsPresets {
40 int Team; /// Team of player -- NOT SELECTABLE YET
41 PlayerTypes Type; /// Type of player (for network games)
42 };
43
44 /**
45 ** Settings structure
46 **
47 ** This structure one day should contain all common game settings,
48 ** in-game, or pre-start, and the individual (per player) presets.
49 ** This allows central maintainance, easy (network-)negotiation,
50 ** simplifies load/save/reinitialization, etc...
51 **
52 */
53 struct Settings {
54 int NetGameType; /// Multiplayer or single player
55
56 // Individual presets:
57 // For single-player game only Presets[0] will be used..
58 SettingsPresets Presets[PlayerMax];
59
60 // Common settings:
61 int Resources; /// Preset resource factor
62 int NumUnits; /// Preset # of units
63 int Opponents; /// Preset # of ai-opponents
64 int Difficulty; /// Terrain type (summer,winter,...)
65 int GameType; /// Game type (melee, free for all,...)
66 bool NoFogOfWar; /// No fog of war
67 int RevealMap; /// Reveal map
68 int MapRichness; /// Map richness
69 };
70
71 #define SettingsPresetMapDefault -1 /// Special: Use map supplied
72
73 /**
74 ** Single or multiplayer settings
75 */
76 #define SettingsSinglePlayerGame 1
77 #define SettingsMultiPlayerGame 2
78
79 /**
80 ** GameType settings
81 */
82 enum GameTypes {
83 SettingsGameTypeMapDefault = SettingsPresetMapDefault,
84 SettingsGameTypeMelee = 0,
85 SettingsGameTypeFreeForAll,
86 SettingsGameTypeTopVsBottom,
87 SettingsGameTypeLeftVsRight,
88 SettingsGameTypeManVsMachine,
89 SettingsGameTypeManTeamVsMachine,
90
91 // Future game type ideas
92 #if 0
93 SettingsGameTypeOneOnOne,
94 SettingsGameTypeCaptureTheFlag,
95 SettingsGameTypeGreed,
96 SettingsGameTypeSlaughter,
97 SettingsGameTypeSuddenDeath,
98 SettingsGameTypeTeamMelee,
99 SettingsGameTypeTeamCaptureTheFlag,
100 #endif
101 };
102
103 extern Settings GameSettings; /// Game settings
104
105 /// Show stats
106 extern void ShowStats();
107 /// Create a game
108 extern void CreateGame(const std::string &filename, CMap *map);
109 /// Init Setting to default values
110 extern void InitSettings(void);
111
112 //@}
113
114 #endif