Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / ryzom / common / src / game_share / item_special_effect.cpp
blob341f1705ecf1c2811b226125506fc9f80f1f7590
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/>.
17 #include "stdpch.h"
19 // nel
20 #include "nel/misc/i18n.h"
21 #include "nel/misc/string_conversion.h"
23 #include "item_special_effect.h"
25 using namespace std;
26 using namespace NLMISC;
28 namespace ITEM_SPECIAL_EFFECT
30 // The conversion table
31 const CStringConversion<TItemSpecialEffect>::CPair stringTable [] =
33 { "ISE_FIGHT_ADD_CRITICAL", ISE_FIGHT_ADD_CRITICAL },
34 { "ISE_FIGHT_VAMPIRISM", ISE_FIGHT_VAMPIRISM },
35 { "ISE_MAGIC_DIVINE_INTERVENTION", ISE_MAGIC_DIVINE_INTERVENTION },
36 { "ISE_MAGIC_SHOOT_AGAIN", ISE_MAGIC_SHOOT_AGAIN },
37 { "ISE_CRAFT_ADD_STAT_BONUS", ISE_CRAFT_ADD_STAT_BONUS },
38 { "ISE_CRAFT_ADD_LIMIT", ISE_CRAFT_ADD_LIMIT },
39 { "ISE_FORAGE_ADD_RM", ISE_FORAGE_ADD_RM },
40 { "ISE_FORAGE_NO_RISK", ISE_FORAGE_NO_RISK },
44 CStringConversion<TItemSpecialEffect> conversion(stringTable, sizeof(stringTable) / sizeof(stringTable[0]), UNDEFINED);
47 // convert item special effect id to item special effect name string
48 const std::string& toString( TItemSpecialEffect itemSpecialEffect )
50 return conversion.toString(itemSpecialEffect);
54 // convert item special effect name to item special effect enum value
55 TItemSpecialEffect fromString( const std::string& str )
57 return conversion.fromString(str);
59 // convert item special effect name to item special effect enum value
60 TItemSpecialEffect stringToItemSpecialEffect( const std::string& str )
62 return conversion.fromString(str);
64 }; // ITEM_SPECIAL_EFFECT