Package clientMessages

Source Code of clientMessages.MoveSpell

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);

    }
   
  }
}
TOP

Related Classes of clientMessages.MoveSpell

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.