Merge branch 'fixes' into main/rendor-staging
[ryzomcore.git] / ryzom / common / src / game_share / mission_desc.cpp
blob37480def19f86adc45675b89edcef625dc939e44
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 "mission_desc.h"
21 #include "nel/misc/string_conversion.h"
24 namespace MISSION_DESC
26 NL_BEGIN_STRING_CONVERSION_TABLE (TStepType)
27 NL_STRING_CONVERSION_TABLE_ENTRY( KillCreature )
28 NL_STRING_CONVERSION_TABLE_ENTRY( Talk )
29 NL_STRING_CONVERSION_TABLE_ENTRY( Target )
30 NL_STRING_CONVERSION_TABLE_ENTRY( SkillProgress )
31 NL_STRING_CONVERSION_TABLE_ENTRY( Craft )
32 NL_STRING_CONVERSION_TABLE_ENTRY( Harvest )
33 NL_STRING_CONVERSION_TABLE_ENTRY( BuyItem )
34 NL_STRING_CONVERSION_TABLE_ENTRY( SellItem )
35 NL_STRING_CONVERSION_TABLE_ENTRY( KillNpc )
36 NL_STRING_CONVERSION_TABLE_ENTRY( GiveItem )
37 NL_STRING_CONVERSION_TABLE_ENTRY( NbStepTypes )
38 NL_END_STRING_CONVERSION_TABLE(TStepType, StepTypeConversion, NbStepTypes)
40 NL_BEGIN_STRING_CONVERSION_TABLE (TRewardType)
41 NL_STRING_CONVERSION_TABLE_ENTRY( Seeds )
42 NL_STRING_CONVERSION_TABLE_ENTRY( Sp )
43 NL_STRING_CONVERSION_TABLE_ENTRY( ZCBuilding )
44 NL_STRING_CONVERSION_TABLE_ENTRY( NbReward )
45 NL_END_STRING_CONVERSION_TABLE(TRewardType, RewardTypeConversion, NbReward)
47 const std::string & toString(TStepType type)
49 return StepTypeConversion.toString( type );
51 TStepType toStepType( const std::string & str )
53 return StepTypeConversion.fromString( str );
56 const std::string & toString(TRewardType type)
58 return RewardTypeConversion.toString( type );
60 TRewardType toRewardType( const std::string & str )
62 return RewardTypeConversion.fromString( str );
66 TClientMissionType getClientMissionType(TIconId iconId)
68 nlctassert(sizeof(IconToClientMissionType)/sizeof(IconToClientMissionType[0]) == NumIcons);
69 if(iconId<0 || iconId>=NumIcons)
70 return Mission;
71 else
72 return IconToClientMissionType[iconId];