package clientMessages;
import java.awt.geom.Point2D;
import units.Unit;
import Client.ClientGameState;
public class MoveUnit extends ClientEventIn{
public final int ID;
public final double x,y;
public MoveUnit(int IDIn,double xIn,double yIn){
ID=IDIn;
x=xIn;
y=yIn;
}
public void eventIn(ClientGameState g) {
Unit u=g.getUnits().get(ID);
if(u != null){
u.setOldLoc(u.getLoc());
u.setLoc(new Point2D.Double(x,y));
u.setTheta();
}else{
System.out.println("Wrong ID in doesnt map to unit!!!!!!! line 25 move unit");
}
}
}