1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010-2018 Winch Gate Property Limited
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.
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/>.
21 #include "nel/misc/sheet_id.h"
22 #include "people_pd.h"
26 // If you change this enum do not forget to update database.xml and local_database.xml
32 BeginClans
, // begin of "real" clans (None and Neutral are excluded)
33 BeginCults
= BeginClans
, // begin the cults section
38 EndCults
= Karavan
, // end of cults
39 BeginCivs
, // begin of civilizations
46 EndCivs
= Zorai
, // end of civs
49 EndClans
= Marauder
, // end of clans
53 NbBits
= 4 // number of bits needed to store all valid values (all but Unknown)
56 TPVPClan
fromString(const std::string
& str
);
57 const std::string
& toString(TPVPClan clan
);
58 std::string
toLowerString(TPVPClan clan
);
60 uint32
getFactionIndex(TPVPClan clan
);
61 TPVPClan
getClanFromIndex(uint32 theIndex
);
62 NLMISC::CSheetId
getFactionSheetId(TPVPClan clan
);
63 TPVPClan
getClanFromPeople( EGSPD::CPeople::TPeople people
);
65 /// For Client Interface, return the define name of the type (eg: "pvp_faction_icon_Kami")
66 std::string
toIconDefineString( TPVPClan c
);
83 void setFactionWar( TPVPClan clan1
, TPVPClan clan2
)
87 if( clan1
< BeginClans
|| clan1
> EndClans
)
89 nlwarning("<CFactionWar::setFactionWar> clan1 is invalid : %d", clan1
);
92 if( clan2
< BeginClans
|| clan2
> EndClans
)
94 nlwarning("<CFactionWar::setFactionWar> clan2 is invalid : %d", clan2
);
102 nlwarning("<CFactionWar::setFactionWar> A clan can't be in war with him");
107 bool inPvPFaction( TPVPClan clan1
, TPVPClan clan2
) const
109 return ( (clan1
== Clan1
&& clan2
== Clan2
) || (clan2
== Clan1
&& clan1
== Clan2
) );
112 void serial( NLMISC::IStream
& f
)
114 f
.serialEnum( Clan1
);
115 f
.serialEnum( Clan2
);
119 } // namespace PVP_CLAN
121 #endif // RY_PVP_CLAN_H