// Ryzom - MMORPG Framework
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
#include "stdpch.h"
#include "nel/misc/debug.h"
#include "rolemaster_flags.h"
#include "nel/misc/string_conversion.h"
namespace ROLEMASTER_FLAGS
{
NL_BEGIN_STRING_CONVERSION_TABLE (TRolemasterFlag)
NL_STRING_CONVERSION_TABLE_ENTRY(FightActions)
NL_STRING_CONVERSION_TABLE_ENTRY(MagicActions)
NL_STRING_CONVERSION_TABLE_ENTRY(ForageActions)
NL_STRING_CONVERSION_TABLE_ENTRY(CraftActions)
NL_STRING_CONVERSION_TABLE_ENTRY(CaracteristicUpgrades)
NL_STRING_CONVERSION_TABLE_ENTRY(SpecialPowers)
NL_STRING_CONVERSION_TABLE_ENTRY(NbFlags)
NL_END_STRING_CONVERSION_TABLE(TRolemasterFlag, ConversionTable, NbFlags)
TRolemasterFlag fromString(const std::string &str)
{
return ConversionTable.fromString(str);
}
const std::string & toString(TRolemasterFlag type)
{
return ConversionTable.toString(type);
}
static bool isPhraseAvailable(const std::string &brickFilter, const std::string &sheetName)
{
return sheetName.substr( 1, brickFilter.size() ) == brickFilter;
}
bool canSellPhrase(uint32 rmfBitField, const std::string &sheetName)
{
// Brick filters :
// b = all phrases
// bf = combat phrase
// bm = magic phrase
// bc = craft phrase
// bhf = forage phrase
// bp = charac phrase
// bsf = fight related special powers
// bsm = magic related special powers
// bsd = defense related special powers (~bsx)
// bsx = unspecialized special powers
// bsg = craft/forage special powers
// *** Test Carac upgrade
if(rmfBitField & (1<