/*
 * Created on 06.12.2004
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package agents;

import knowledgeAndTechnics.Intelligence;
import knowledgeAndTechnics.NoFreePlayerException;

/**
 * @author Administrator
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class U06_MidfieldLeftInAgent extends Midfield {

    public void playerInitialization(){
		baseFunctions.init(infoPool.getTeamName());
		
		//Die Startposition
		infoPool.setXPlayerStart(-17.5);
		infoPool.setYPlayerStart(-6.8);
		
		// Die Ruheposition
		infoPool.setXPlayerHome(0);
		infoPool.setYPlayerHome(-6.8);
		// Der Handlungsbereich
		infoPool.setX1PlayerActingField(-36.5);
		infoPool.setY1PlayerActingField(-20.4);
		infoPool.setX2PlayerActingField(36.5);
		infoPool.setY2PlayerActingField(6.8);
		// weitere Variablen
		infoPool.setX1PlayerFreeKickField(-17.5); //außerhalb, damit er nix tut
		infoPool.setY1PlayerFreeKickField(-17);
		infoPool.setX2PlayerFreeKickField(17.5);
		infoPool.setY2PlayerFreeKickField(0);
	}
    
    public void handleKickOffWe(){
    	infoPool.setBallPossession(Intelligence.BALL_POSSESSION_WE);
    	baseFunctions.changeViewWithoutWaiting("normal", "high");
    	baseFunctions.turnNeckRelToBodyWithoutWaiting(0);
    	infoPool.runToBall(80,100);
		baseFunctions.turnAbs(-135);
		infoPool.setBallPossession(Intelligence.BALL_POSSESSION_ME);
		//infoPool.resetLastKickTime();
		try {
			infoPool.passToFreePlayer(infoPool.getFreePlayer());
		} catch (NoFreePlayerException e){
			baseFunctions.kick(100, -135 - infoPool.getBodyDirection());
		}
		
	}
    
    
    /**
     * @param args
     */
    public U06_MidfieldLeftInAgent(String[] args) {
        super(args);
        // TODO Auto-generated constructor stub
    }
    
   
    
    public static void main(String[] args) {
		U06_MidfieldLeftInAgent d = new U06_MidfieldLeftInAgent(args);
		d.start();
	}

}
