1 //       _________ __                 __
2 //      /   _____//  |_____________ _/  |______     ____  __ __  ______
3 //      \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
4 //      /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ |
5 //     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
6 //             \/                  \/          \//_____/            \/
7 //  ______________________                           ______________________
8 //                        T H E   W A R   B E G I N S
9 //         Stratagus - A free fantasy real time strategy game engine
10 //
11 /**@name world.h - The world header file. */
12 //
13 //      (c) Copyright 2016-2019 by Andrettin
14 //
15 //      This program is free software; you can redistribute it and/or modify
16 //      it under the terms of the GNU General Public License as published by
17 //      the Free Software Foundation; only version 2 of the License.
18 //
19 //      This program is distributed in the hope that it will be useful,
20 //      but WITHOUT ANY WARRANTY; without even the implied warranty of
21 //      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 //      GNU General Public License for more details.
23 //
24 //      You should have received a copy of the GNU General Public License
25 //      along with this program; if not, write to the Free Software
26 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 //      02111-1307, USA.
28 //
29 
30 #ifndef __WORLD_H__
31 #define __WORLD_H__
32 
33 /*----------------------------------------------------------------------------
34 --  Includes
35 ----------------------------------------------------------------------------*/
36 
37 #include "data_type.h"
38 
39 #include <map>
40 #include <string>
41 #include <vector>
42 
43 /*----------------------------------------------------------------------------
44 --  Declarations
45 ----------------------------------------------------------------------------*/
46 
47 class CPlane;
48 class CProvince;
49 class CSeasonSchedule;
50 class CSpecies;
51 class CTerrainFeature;
52 class CTimeOfDaySchedule;
53 
54 class CWorld : public CDataType
55 {
56 public:
57 	static CWorld *GetWorld(const std::string &ident, const bool should_find = true);
58 	static CWorld *GetOrAddWorld(const std::string &ident);
59 	static void ClearWorlds();
60 
61 	static std::vector<CWorld *> Worlds;								/// Worlds
62 	static std::map<std::string, CWorld *> WorldsByIdent;
63 
64 	virtual void ProcessConfigData(const CConfigData *config_data) override;
65 
66 	int ID = -1;														/// ID of this world
67 	std::string Name;
68 	std::string Description;
69 	std::string Background;
70 	std::string Quote;
71 	CPlane *Plane = nullptr;
72 	CTimeOfDaySchedule *TimeOfDaySchedule = nullptr;					/// this world's time of day schedule
73 	CSeasonSchedule *SeasonSchedule = nullptr;							/// this world's season schedule
74 	std::vector<CProvince *> Provinces;									/// Provinces in this world
75 	std::vector<CTerrainFeature *> TerrainFeatures;						/// Terrain features in this world
76 	std::vector<CSpecies *> Species;									/// Species in this world
77 };
78 
79 #endif
80