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