khanat-opennel-code/code/ryzom/server/src/server_share/target.cpp

63 lines
2.3 KiB
C++

// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// 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 <http://www.gnu.org/licenses/>.
/////////////
// INCLUDE //
/////////////
#include "stdpch.h"
// Misc
#include "nel/misc/debug.h"
#include "nel/misc/string_conversion.h"
// Game Share
#include "target.h"
using namespace std;
using namespace NLMISC;
namespace TARGET
{
// TARGET TABLE
NL_BEGIN_STRING_CONVERSION_TABLE (TTargetRestriction)
NL_STRING_CONVERSION_TABLE_ENTRY(EveryBody)
NL_STRING_CONVERSION_TABLE_ENTRY(SelfOnly)
NL_END_STRING_CONVERSION_TABLE(TTargetRestriction, TargetRestrictionConversion, EveryBody)
//-------------------------------------------
// stringToRestriction :
// Get the Enum Value for a given target's restriction in string.
// \param str : the input string
// \return TTargetRestriction : the target's restriction value (for the enum).
//-------------------------------------------
TARGET::TTargetRestriction stringToTargetRestriction(const std::string &str)
{
return TargetRestrictionConversion.fromString(str);
}// stringToRestriction //
//-------------------------------------------
// targetRestrictionToString :
// Get the string for a given target's restriction.
// \param targetRestriction : target's restriction
// \return string : the target's restriction as a string.
//-------------------------------------------
const std::string & targetRestrictionToString(TARGET::TTargetRestriction targetRestriction)
{
return TargetRestrictionConversion.toString(targetRestriction);
}// targetRestrictionToString //
};// TARGET