package clientMessages;
import java.awt.geom.Point2D;
import spells.Spell;
import Client.ClientGameState;
public class MoveSpell extends ClientEventIn {
public final int ID;
public final double x,y;
public MoveSpell(int IDIn,double xIn, double yIn){
ID=IDIn;
x=xIn;
y=yIn;
}
public void eventIn(ClientGameState g) {
Spell s=g.getSpells().get(ID);
if(s!=null){
s.setOldLoc(s.getLoc());
s.setLoc(new Point2D.Double(x,y));
}else{
System.out.println("ID move:"+ID);
System.out.println("ID's spells:");
for(Spell i :g.getSpells().values())
System.out.println(i.ID);
}
}
}