Package clientMessages

Source Code of clientMessages.NewUnit

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
      }
       
    }
  }
}
TOP

Related Classes of clientMessages.NewUnit

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.