Package units

Examples of units.Unit


    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");
    }
   
  }
View Full Code Here


  }
 
  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
      }
       
    }
  }
View Full Code Here

    unitID=unitIDIn;
    System.out.print("New motion:"+x+","+y+"\n");
  }
 
  public void modifyGameState(GameState g) {
    Unit u=g.getUnits().get(unitID);
    if(!(u==null)){
      u.setMove(new Point2D.Double(x, y));
     

    }
  }
View Full Code Here

  }
 
 
  public void networkServerMessageIn(ClientEventOut in,GameState g) {
    SpellCastEvent i=(SpellCastEvent)in;
    Unit u=g.getUnits().get(i.unitSource);
    if(u !=null){
      g.getSpells().put(i.ID,newSpell(i,  u));
      g.udp.newSpell(i.ID, i.unitSource, i.type, u.getLoc().getX(),u.getLoc().getY());
    }else{
     
    }
  }
View Full Code Here

//    return Enums.ranbowLazer1;
//  }

  public void networkServerMessageIn(ClientEventOut in,GameState g) {
    SpellCastEvent i=(SpellCastEvent)in;
    Unit u=g.getUnits().get(i.unitSource);
    if(u !=null){
      g.getSpells().put(i.ID, new RainbowCannon(i.ID,i.unitSource,i.theta,new Point2D.Double(u.getLoc().getX(),u.getLoc().getY())));
      g.udp.newSpell(i.ID, i.unitSource, i.type, u.getLoc().getX(),u.getLoc().getY());
    }
  }
View Full Code Here

TOP

Related Classes of units.Unit

Copyright © 2018 www.massapicom. 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.