Package clientMessages

Source Code of clientMessages.MoveUnit

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");
    }
   
  }
}
TOP

Related Classes of clientMessages.MoveUnit

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.