/* 
 * Tactic is the legal property of its developers, whose names are too numerous 
 * to list here.  Please refer to the COPYRIGHT file distributed with this 
 * source distribution. 
 * 
 * This library is free software; you can redistribute it and/or 
 * modify it under the terms of the GNU Lesser General Public 
 * License as published by the Free Software Foundation; either 
 * version 2.1 of the License, or (at your option) any later version. 
 * 
 * This library 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 
 * Lesser General Public License for more details. 
 * 
 * You should have received a copy of the GNU Lesser General Public 
 * License along with this library; if not, write to the Free Software 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
 *
 * See README for more informations
 *
 * Converter.cpp
 *
 * Class which convert different type to string
 *
 * Date 12/02/06
 *
 */

#include "Converter.h"

using namespace std;

Converter::Converter(){}

std::string Converter::floatToString(float f){
	ostringstream os;
	os << f;
	return os.str();
}

std::string Converter::convert(fuzzyValueName fvn){
	switch(fvn){

		// Order

		case ORDER_NO_ORDER :
			return "no order";
/*		case ORDER_DIVIDE :
			return "divide";
		case ORDER_REGROUP :
			return "regroup";
		case ORDER_CHOOSE_FORMATION :
			return "choose formation";
		case ORDER_HOLD_POSITION :
			return "hold position";
		case ORDER_REORGANIZE :
			return "reorganize";
		case ORDER_CHARGE :
			return "charge";
		case ORDER_END_FIGHT :
			return "end fight";
		case ORDER_ENNEMY_OUT_OF_SIGHT :
			return "ennemy out of sight";
		case ORDER_MOVE :
			return "move";*/
		case ORDER_FLEE :
			return "flee";
/*		case ORDER_AWOKEN :
			return "awoken";
		case ORDER_SEE :
			return "see";
		case ORDER_HIT :
			return "hit";
		case ORDER_SLEEP :
			return "sleep";
		case ORDER_MOUNT :
			return "mount";
		case ORDER_DISMOUNT :
			return "dismount";*/
		case ORDER_ATTACK :
			return "attack";
/*		case ORDER_DEFEND :
			return "defend";
		case ORDER_HIDDEN :
			return "hidden";
		case ORDER_GROUP_JOINED :
			return "group joined";
		case ORDER_SCATTER :
			return "scatter";
		case ORDER_HIDE :
			return "hide";
		case ORDER_PATROL :
			return "patrol";
		case ORDER_FOLLOW :
			return "follow";*/
		case ORDER_RECONNAISSANCE :
			return "reconnaissance";
		case ORDER_EVALUATION :
			return "order evaluation";
/*		case ORDER_SHORTCUT :
			return "shortcut";
		case ORDER_SNEAK :
			return "sneak";
		case ORDER_POSITION_REACHED:
			return "position reached";*/

		// Values
			
		case ABSTRACT_FUZZY_VALUE :
			return "Abstract_FuzzyValue";
		case NB_ENNEMY_UNIT_MIDDLE :
			return "NbEnnemyUnitMiddle";
		case NB_ENNEMY_UNIT_LOW :
			return "NbEnnemyUnitLow";
		case NB_ENNEMY_UNIT_HIGH :
			return "NbEnnemyUnitHigh";
		case HP_HIGH :
			return "HPHigh";
		case HP_MIDDLE :
			return "HPMiddle";
		case HP_LOW :
			return "HPLow";
		case FORCE_HIGH :
			return "ForceHigh";
		case FORCE_MIDDLE :
			return "ForceMiddle";
		case FORCE_LOW :
			return "ForceLow";
		case BAD_SUPPORT :
			return "BadSupport";
		case CLOSED_ZONE :
			return "ClosedZone";
		case FAR_ZONE :
			return "FarZone";
		case FRESH_ZONE :
			return "FreshZone";
		case OUT_DATED_ZONE :
			return "OutDatedZone";
		case GOOD_SUPPORT :
			return "GoodSupport";
		case NB_VISIBLE_UNIT_HIGH :
			return "NbVisibleUnitHigh";
		case NB_VISIBLE_UNIT_LOW :
			return "NbVisibleUnitLow";
		case NB_VISIBLE_UNIT_MIDDLE :
			return "NbVisibleUnitMiddle";
		case VALUE_AND :
			return "value_and";
		case VALUE_OR :
			return "value_or";
		case VALUE_EMPTY :
			return "value_empty";
		case VALUE_LIST_RESULT_EMPTY :
			return "list of result is empty";
		case VALUE_INFERATE_NOT_USED :
			return "inferate not used";

		default :
			return "ERROR, wrong fuzzyValueName";
	}
}

std::string Converter::convert(fuzzyNumberName fnn){
	switch(fnn){

		// FuzzyNumber

		case ABSTRACT_FUZZY_NUMBER :
			return "Abstract_FuzzyNumber";
		case NB_VISIBLE_UNIT :
			return "Nb_Visible_Unit";
		case FRESH :
			return "Fresh";
		case DISTANCE :
			return "Distance";
		case NB_ENNEMIS :
			return "Nb_Ennemis";
		case FORCE :
			return "Force";
		case ALLY_HEALTH_POINT :
			return "Ally_Health_Point";
		case ENNEMY_HEALTH_POINT :
			return "Ennemy_health_Point";
		case SUPPORT :
			return "Support";

		default :
			return "ERROR, wrong fuzzyNumberName";
	}
			
}