/**
 * \file Variables.h
 * \date 30.03.2002
 *
 * Interface for the coach adjustable variables class
 */

#ifndef COMMON_WORLD_VARIABLES_H
#define COMMON_WORLD_VARIABLES_H

#include "Player/World/WorldObject.h"

class Variables : public WorldObject
{
public:
	Variables(World* w);
	Variables(const Variables& variables);
	virtual Variables& operator=(const Variables&);
	virtual ~Variables();

	void Initialize();
	bool ParseVariable(const char *name, const char *value);

	virtual float GetDistanceToGoal() const { return distanceToGoal; }
	virtual void SetDistanceToGoal(float dtg) { distanceToGoal = dtg; }

	virtual int GetKickToGoalDirection() const { return kickToGoalDirection; }
	virtual void SetKickToGoalDirection(int ktgd) { kickToGoalDirection = ktgd; }

	virtual float GetDribleSurroundingsMinWidth() const { return dribleSurroundingsMinWidth; }
	virtual void SetDribleSurroundingsMinWidth(float dsmw) { dribleSurroundingsMinWidth = dsmw; }

	virtual float GetDribleSurroundingsMaxWidth() const { return dribleSurroundingsMaxWidth; }
	virtual void SetDribleSurroundingsMaxWidth(float dsmw) { dribleSurroundingsMaxWidth = dsmw; }
	
	virtual float GetPassSurroundingsMinWidth() const { return passSurroundingsMinWidth; }
	virtual void SetPassSurroundingsMinWidth(float psmw) { passSurroundingsMinWidth = psmw; }

	virtual float GetPassSurroundingsMaxWidth() const { return passSurroundingsMaxWidth; }
	virtual void SetPassSurroundingsMaxWidth(float psmw) { passSurroundingsMaxWidth = psmw; }

	virtual float GetMinXPosition() const { return minXPosition; }
	virtual void SetMinXPosition(float mxp) { minXPosition = mxp; }

	virtual float GetMaxXPosition() const { return maxXPosition; }
	virtual void SetMaxXPosition(float mxp) { maxXPosition = mxp; }

	virtual float GetFriendDashAdjust() const { return friendDashAdjust; }
	virtual void SetFriendDashAdjust(float fda) { friendDashAdjust = fda; }

	virtual float GetEnemyDashAdjust() const { return enemyDashAdjust; }
	virtual void SetEnemyDashAdjust(float eda) { enemyDashAdjust = eda; }

	virtual float GetFriendBallCtrlBonus() const { return friendBallCtrlBonus; }
	virtual void SetFriendBallCtrlBonus(float fbcb) { friendBallCtrlBonus = fbcb; }
	
	virtual float GetEnemyBallCtrlBonus() const { return enemyBallCtrlBonus; }
	virtual void SetEnemyBallCtrlBonus(float ebcb) { enemyBallCtrlBonus = ebcb; }
	
	virtual float GetTooMuchFriendCnt() const { return tooMuchFriendCnt; }
	virtual void SetTooMuchFriendCnt(float tmfc) { tooMuchFriendCnt = tmfc; }
	
	virtual float GetTooMuchEnemyCnt() const { return tooMuchEnemyCnt; }
	virtual void SetTooMuchEnemyCnt(float tmec) { tooMuchEnemyCnt = tmec; }

	virtual bool GetUseNeuralNetwork() const { return useNeuralNetwork; }
	virtual void SetUseNeuralNetwork(bool unn = true) { useNeuralNetwork = unn; }

private:
	/**
	 * Specifies distance to goal in meters at which the player tries to kick to goal.
	 */
	float distanceToGoal;
	/**
	 * Specifies direction of shooting in the area between goalie, enemy players and
	 * the stick. The player tries to shoot to the center of the free area by default.
	 * The center corresponds to zero value of the parameter kickToGoalDirection.
	 * However, this does not need to be an ideal solution in every situation. Thus, the
	 * value of the parameter can be modified in the range from -100 to 100 (percents)
	 * which corresponds to angular displacement from -45 to 45 (degrees)
	 */
	int kickToGoalDirection;
	/**
	 * Specifies the minimum distance between player and enemy player at which the player
	 * still considers an enemy to be the part of the surroundings to be aware of.
	 */
	float dribleSurroundingsMinWidth; 
	/**
	 * Specifies the maximum distance between player and enemy player at which the player
	 * still considers an enemy to be the part of the surroundings to be aware of.
	 */
	float dribleSurroundingsMaxWidth;
	/**
	 * Specifies the minimum distance between player and co-player at which the player
	 * still considers a co-player to be the part of the passable surroundings.
	 */
	float passSurroundingsMinWidth;
	/**
	 * Specifies the maximum distance between player and co-player at which the player
	 * still considers a co-player to be the part of the passable surroundings.
	 */
	float passSurroundingsMaxWidth;
	//komentare k nasledujucim dvom parametrom su na <>.
	/**
	 * Specifies the treshold at which the player pass the ball directly instead of
	 * passing ball to run. 
	 */
	float minXPosition;
	/**
	 * Specifies the treshold at which the player pass the ball directly instead of
	 * passing ball to run. 
	 */
	float maxXPosition;

	/**
	 * Adjusts friend player average dash power. Used for simulating friendly
	 * player movements.
	 */
	float friendDashAdjust;
	/**
	 * Adjusts enemy player average dash power. Used for simulating enemy
	 * player movements.
	 */
	float enemyDashAdjust;
	
	/**
	 * When our player gets to ball one cycle sooner then enemy, he is 
	 * considered friendBallCtrlBonus times stronger.
	 */
	float friendBallCtrlBonus;
	/**
	 * When enemy player gets to ball one cycle sooner then our, he is 
	 * considered friendBallCtrlBonus times stronger.
	 */
	float enemyBallCtrlBonus;
	/**
	 * This many friends catching the ball at once are allowed (maximum). 
	 */
	float tooMuchFriendCnt;
	/**
	 * This many enemies catching the ball at once are allowed (maximum). 
	 * More enemies mean we cannot (and as so do not try to) get the ball.
	 */
	float tooMuchEnemyCnt;

	// GP
	// use NN in decision tree?
	bool useNeuralNetwork;

};

#endif // COMMON_WORLD_VARIABLES_H
