Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / ryzom / common / src / game_share / continent.h
blobd6b0bd854e65bf7a7152364e5d488233a4f81620
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program 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 Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef RYZOM_CONTINENT_H
20 #define RYZOM_CONTINENT_H
22 #include "nel/misc/types_nl.h"
24 namespace CONTINENT
26 enum TContinent
28 FYROS = 0,
29 ZORAI,
30 TRYKER,
31 MATIS,
32 BAGNE,
33 NEXUS,
34 ROUTE_GOUFFRE,
35 SOURCES,
36 TERRE,
37 FYROS_ISLAND,
38 FYROS_NEWBIE,
39 TRYKER_ISLAND,
40 TRYKER_NEWBIE,
41 ZORAI_ISLAND,
42 MATIS_ISLAND,
43 ZORAI_NEWBIE,
44 MATIS_NEWBIE,
45 TESTROOM,
46 INDOORS,
47 NEWBIELAND,
48 R2_ROOTS,
49 R2_DESERT,
50 R2_LAKES,
51 R2_FOREST,
52 R2_JUNGLE,
53 CORRUPTED_MOOR,
54 KITINIERE,
56 UNKNOWN,
57 // NB_RESPAWN_POINT_TYPE = UNKNOWN,
58 NB_CONTINENTS = UNKNOWN
62 /**
63 * get continent type corresponding to input string
64 * \param str the input string
65 * \return the TContinent associated to this string (UNKNOWN if the string cannot be interpreted)
67 TContinent toContinent(const std::string &str);
69 /**
70 * get the continent type string corresponding to enum
71 * \param nature the TContinent value
72 * \return nature as a string (or UNKNOWN)
74 const std::string& toString(TContinent continent);
76 // A small wrapper around the continent enum to allow it
77 // to be used as a serialisable map key.
78 struct TContinentId
81 TContinentId()
82 : _Continent(CONTINENT::UNKNOWN)
85 TContinentId(CONTINENT::TContinent cont)
86 : _Continent(cont)
89 void serial(NLMISC::IStream &s)
91 s.serialEnum(_Continent);
94 bool operator < (const TContinentId &other) const
96 return _Continent < other._Continent;
99 bool operator == (const TContinentId &other) const
101 return _Continent == other._Continent;
104 private:
105 CONTINENT::TContinent _Continent;
108 // A container to host respawn points counters
109 typedef std::map < TContinentId, uint32 > TRespawnPointCounters;
112 }; // namespace CONTINENT
114 #endif // RYZOM_CONTINENT_H
115 /* End of continent.h */