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

import gameObjects.Flag;
import coolPlayerControl.CoolPlayerControl;
//import other.InformationPool;

/**
 * @author Boris
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class KeyControlledAgent extends Agent{
	private static KeyControlledAgent maik;
	private static Flag goal;
	CoolPlayerControl cpc;
	private int lastTime = 0;
	
	public KeyControlledAgent(String[] args) {
		super(args);
	}	
	
	public void playerInitialization(){
		baseFunctions.init(infoPool.getTeamName());
		
		//Die Startposition
		infoPool.setXPlayerStart(-15);
		infoPool.setYPlayerStart(10);
		
		// Die Ruheposition
		infoPool.setXPlayerHome(-25);
		infoPool.setYPlayerHome(10);
		// Der Handlungsbereich
		infoPool.setX1PlayerActingField(-52.5);
		infoPool.setY1PlayerActingField(-34);
		infoPool.setX2PlayerActingField(52.5);
		infoPool.setY2PlayerActingField(34);
		// weitere Variablen
		infoPool.setX1PlayerFreeKickField(-60); //außerhalb, damit er nix tut
		infoPool.setY1PlayerFreeKickField(-60);
		infoPool.setX2PlayerFreeKickField(-60);
		infoPool.setY2PlayerFreeKickField(-60);
	}
	
	public static void main(String[] args) {
		
		maik = new KeyControlledAgent(args);
		maik.baseFunctions.init(maik.infoPool.getTeamName()); 
		maik.baseFunctions.move(-40, 0);
		CoolPlayerControl cpc = new CoolPlayerControl(maik.baseFunctions);
		cpc.setVisible(true);
		while(cpc.isVisible()){
			if (maik.infoPool.getSenseBodyTime() > maik.lastTime) {
				maik.lastTime = maik.infoPool.getSenseBodyTime();
				cpc.tick();
			}else {
				Thread.yield();
				
				
			}
			
		}
	}
}
