/* 
 * 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
 *
 * Fresh.cpp
 *
 * Date 18/03/06
 *
 */

#include "Fresh.h"
#include "FreshZone.h"
#include "OutDatedZone.h"

using namespace std;
	
Fresh::Fresh(void){
	name = FRESH;
}

Fresh::Fresh(vector<FuzzyValue*> vect){
	name = FRESH;
	this->setVect(vect);
}

Fresh::Fresh(FreshZone* fv1, OutDatedZone* fv2){
	name = FRESH;
	vector<FuzzyValue*> vect = vector<FuzzyValue*>();
	vect.push_back(fv1);
	vect.push_back(fv2);
	this->setVect(vect);
}

Fresh::~Fresh(void){}

void Fresh::update(void){
	// à voir
	ground::GroundArmyInfo::VisibilityAreaInfo info;
	info = infoGround->getTimeAverage(pt2d,10);
	value = info.average;
	notify();
	DebugAI::trace('n', "time = " + Converter::floatToString(value));
	DebugAI::trace('n', toString());
	DebugAI::trace('n', pt2d.toString());
}

void Fresh::setInfoGround(ground::GroundArmyInfo* infoG){
	infoGround = infoG;
}

void Fresh::setPt2D(Point2D pt2d){
	this->pt2d = pt2d;
}
