package agents;


/*
 * Created on Oct 12, 2004
 *
 */

/**
 * Steht nur dumm rum
 * @author wir
 * 
 */
public class KickToGoalAgent extends Agent {
	public void playerInitialization(){
		baseFunctions.init(infoPool.getTeamName());
		
		//Die Startposition
		infoPool.setXPlayerStart(-30);
		infoPool.setYPlayerStart(-20);
		
		// Die Ruheposition
		infoPool.setXPlayerHome(-30);
		infoPool.setYPlayerHome(-20);
		// Der Handlungsbereich
		infoPool.setX1PlayerActingField(-52.5);
		infoPool.setY1PlayerActingField(-34);
		infoPool.setX2PlayerActingField(52.5);
		infoPool.setY2PlayerActingField(34);
		// weitere Variablen
		infoPool.setX1PlayerFreeKickField(-52.5); //außerhalb, damit er nix tut
		infoPool.setY1PlayerFreeKickField(-34);
		infoPool.setX2PlayerFreeKickField(52.5);
		infoPool.setY2PlayerFreeKickField(34);
	}
	
	
	
	public KickToGoalAgent(String[] args){
		super(args);
	}
	
	/*public void handleKickOffWe(){

	    try{
	        sender.kick(25, 0);
	        System.out.println("Ballgeschwindigkeit " +infoPool.getBall().getDistChange()
	                +"\nerrechnete Ballgeschwindigkeit " + infoPool.getBall().getSpeed());
	    }catch (Exception e){}
	}
*/	
	public void handlePlayOn(){
		//double y = Math.random()*20;
		//double x = Math.random()*20;
			infoPool.searchBall(0);
			infoPool.runToXY(infoPool.getBall().getAbsX(),infoPool.getBall().getAbsY(), 100);
		
		infoPool.kickToGoal();
	}
	
	public static void main(String[] args) {
		KickToGoalAgent d = new KickToGoalAgent(args);
		d.start();
	}
}
