package clientMessages;
import units.Unit;
import Client.ClientGameState;
import Global_Package.Entity;
import Global_Package.Enums;
public class NewUnit extends ClientEventIn{
public final int ID,type;
public final double x,y;
public final int OwnerID;
public NewUnit(int IDIn,int OwnerID,int typeIn,float xIn,float yIn){
x=xIn;
y=yIn;
type=typeIn;
ID=IDIn;
this.OwnerID=OwnerID;
}
public void eventIn(ClientGameState g){
for(Entity e:Enums.effectiveMap.values()){
if(e.checkType(type)){
Unit i=(Unit)e;
i.newUnit(this, g);
return; //only works once any way
}
}
}
}