Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / ryzom / common / src / game_share / outpost.cpp
blobdb7425c5718d0e545d68e34736a10b4343196e82
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 #include "stdpch.h"
20 #include "nel/misc/debug.h"
21 #include "nel/misc/string_conversion.h"
22 #include "outpost.h"
24 using namespace std;
25 using namespace NLMISC;
27 namespace OUTPOSTENUMS
30 NL_BEGIN_STRING_CONVERSION_TABLE (TPVPType)
31 NL_STRING_CONVERSION_TABLE_ENTRY(PVE)
32 NL_STRING_CONVERSION_TABLE_ENTRY(PVP)
33 NL_STRING_CONVERSION_TABLE_ENTRY(RVR)
34 NL_STRING_CONVERSION_TABLE_ENTRY(Full)
35 NL_STRING_CONVERSION_TABLE_ENTRY(GVE)
36 NL_STRING_CONVERSION_TABLE_ENTRY(GVG)
37 NL_STRING_CONVERSION_TABLE_ENTRY(UnknownPVPType)
38 NL_END_STRING_CONVERSION_TABLE(TPVPType, StaticCOutpostTPVPTypeConversion, UnknownPVPType)
40 NL_BEGIN_STRING_CONVERSION_TABLE (TPVPSide)
41 NL_STRING_CONVERSION_TABLE_ENTRY(OutpostOwner)
42 NL_STRING_CONVERSION_TABLE_ENTRY(OutpostAttacker)
43 NL_STRING_CONVERSION_TABLE_ENTRY(UnknownPVPSide)
44 NL_END_STRING_CONVERSION_TABLE(TPVPSide, StaticCOutpostTPVPSideConversion, UnknownPVPSide)
46 NL_BEGIN_STRING_CONVERSION_TABLE (TOutpostState)
47 NL_STRING_CONVERSION_TABLE_ENTRY(Peace)
48 NL_STRING_CONVERSION_TABLE_ENTRY(WarDeclaration)
49 NL_STRING_CONVERSION_TABLE_ENTRY(AttackBefore)
50 NL_STRING_CONVERSION_TABLE_ENTRY(AttackRound)
51 NL_STRING_CONVERSION_TABLE_ENTRY(AttackAfter)
52 NL_STRING_CONVERSION_TABLE_ENTRY(DefenseBefore)
53 NL_STRING_CONVERSION_TABLE_ENTRY(DefenseRound)
54 NL_STRING_CONVERSION_TABLE_ENTRY(DefenseAfter)
55 NL_STRING_CONVERSION_TABLE_ENTRY(UnknownOutpostState)
56 NL_END_STRING_CONVERSION_TABLE(TOutpostState, StaticCOutpostStateConversion, UnknownOutpostState)
58 NL_BEGIN_STRING_CONVERSION_TABLE (TOutpostEvent)
59 NL_STRING_CONVERSION_TABLE_ENTRY(StartOfState)
60 NL_STRING_CONVERSION_TABLE_ENTRY(EndOfState)
61 NL_STRING_CONVERSION_TABLE_ENTRY(Challenged)
62 NL_STRING_CONVERSION_TABLE_ENTRY(OwnerVanished)
63 NL_STRING_CONVERSION_TABLE_ENTRY(AttackerVanished)
64 NL_STRING_CONVERSION_TABLE_ENTRY(Timer0End)
65 NL_STRING_CONVERSION_TABLE_ENTRY(Timer1End)
66 NL_STRING_CONVERSION_TABLE_ENTRY(Timer2End)
67 NL_STRING_CONVERSION_TABLE_ENTRY(AttackerGiveUp)
68 NL_STRING_CONVERSION_TABLE_ENTRY(OwnerGiveUp)
69 NL_STRING_CONVERSION_TABLE_ENTRY(SquadKilled)
70 NL_STRING_CONVERSION_TABLE_ENTRY(EventAisUp)
71 NL_STRING_CONVERSION_TABLE_ENTRY(EventAisDown)
72 NL_STRING_CONVERSION_TABLE_ENTRY(UnknownOutpostEvent)
73 NL_END_STRING_CONVERSION_TABLE(TOutpostEvent, StaticOutpostEventConversion, UnknownOutpostEvent)
75 NL_BEGIN_STRING_CONVERSION_TABLE (TSquadType)
76 NL_STRING_CONVERSION_TABLE_ENTRY(Default)
77 NL_STRING_CONVERSION_TABLE_ENTRY(Recruited)
78 NL_STRING_CONVERSION_TABLE_ENTRY(Mercenary)
79 NL_STRING_CONVERSION_TABLE_ENTRY(UnknownSquadType)
80 NL_END_STRING_CONVERSION_TABLE(TSquadType, StaticCOutpostSquadTypeConversion, UnknownSquadType)
82 NL_BEGIN_STRING_CONVERSION_TABLE (TSquadState)
83 NL_STRING_CONVERSION_TABLE_ENTRY(NotCreated)
84 NL_STRING_CONVERSION_TABLE_ENTRY(NotReady)
85 NL_STRING_CONVERSION_TABLE_ENTRY(NotSpawned)
86 NL_STRING_CONVERSION_TABLE_ENTRY(Spawning)
87 NL_STRING_CONVERSION_TABLE_ENTRY(Spawned)
88 NL_STRING_CONVERSION_TABLE_ENTRY(Dead)
89 NL_STRING_CONVERSION_TABLE_ENTRY(UnknownSquadState)
90 NL_END_STRING_CONVERSION_TABLE(TSquadState, StaticCOutpostSquadStateConversion, UnknownSquadState)
92 NL_BEGIN_STRING_CONVERSION_TABLE (TSpecialOutpostEvent)
93 NL_STRING_CONVERSION_TABLE_ENTRY(PeaceStateBegin)
94 NL_STRING_CONVERSION_TABLE_ENTRY(PeaceStateEnd)
95 NL_STRING_CONVERSION_TABLE_ENTRY(TribeOwnershipBegin)
96 NL_STRING_CONVERSION_TABLE_ENTRY(TribeOwnershipEnd)
97 NL_STRING_CONVERSION_TABLE_ENTRY(GuildOwnershipBegin)
98 NL_STRING_CONVERSION_TABLE_ENTRY(GuildOwnershipEnd)
99 NL_STRING_CONVERSION_TABLE_ENTRY(StateChanged)
100 NL_STRING_CONVERSION_TABLE_ENTRY(OwnerChanged)
101 NL_STRING_CONVERSION_TABLE_ENTRY(AttackerChanged)
102 NL_END_STRING_CONVERSION_TABLE(TSpecialOutpostEvent, StaticSpecialOutpostEventConversion, UnknownSpecialOutpostEvent)
104 std::string const& toString(TPVPType val) { return StaticCOutpostTPVPTypeConversion.toString(val); }
105 TPVPType toPVPType(std::string const& val) { return StaticCOutpostTPVPTypeConversion.fromString(val); }
106 std::string const& toString(TPVPSide val) { return StaticCOutpostTPVPSideConversion.toString(val); }
107 TPVPSide toPVPSide(std::string const& val) { return StaticCOutpostTPVPSideConversion.fromString(val); }
108 std::string const& toString(TOutpostState val) { return StaticCOutpostStateConversion.toString(val); }
109 TOutpostState toOutpostState(std::string const& val) { return StaticCOutpostStateConversion.fromString(val); }
110 std::string const& toString(TOutpostEvent val) { return StaticOutpostEventConversion.toString(val); }
111 TOutpostEvent toOutpostEvent(std::string const& val) { return StaticOutpostEventConversion.fromString(val); }
112 std::string const& toString(TSquadType val) { return StaticCOutpostSquadTypeConversion.toString(val); }
113 TSquadType toSquadType(std::string const& val) { return StaticCOutpostSquadTypeConversion.fromString(val); }
114 std::string const& toString(TSquadState val) { return StaticCOutpostSquadStateConversion.toString(val); }
115 TSquadState toSquadState(std::string const& val) { return StaticCOutpostSquadStateConversion.fromString(val); }
116 std::string const& toString(TSpecialOutpostEvent val) { return StaticSpecialOutpostEventConversion.toString(val); }
117 TSpecialOutpostEvent toSpecialOutpostEvent(std::string const& val) { return StaticSpecialOutpostEventConversion.fromString(val); }