Examples of Tank


Examples of buildcraft.core.fluids.Tank

  }

  @Override
  public int fill(ForgeDirection from, FluidStack resource, boolean doFill) {
    Fluid fluid = resource.getFluid();
    Tank emptyTank = null;
    for (Tank tank : fluidTanks) {
      Fluid type = tank.getFluidType();
      if (type == fluid) {
        int used = tank.fill(resource, doFill);
        if (used > 0 && doFill) {
          sendNetworkUpdate();
        }
        return used;
      } else if (emptyTank == null && tank.isEmpty()) {
        emptyTank = tank;
      }
    }
    if (emptyTank != null) {
      int used = emptyTank.fill(resource, doFill);
      if (used > 0 && doFill) {
        sendNetworkUpdate();
      }
      return used;
    }
View Full Code Here

Examples of buildcraft.core.fluids.Tank

    }

    drawBackgroundSlots();

    for (int i = 0; i < builder.fluidTanks.length; i++) {
      Tank tank = builder.fluidTanks[i];
      drawFluid(tank.getFluid(), guiLeft + 179 + 18 * i, guiTop + 145, 16, 47, tank.getCapacity());
    }
    mc.renderEngine.bindTexture(FOREGROUND_TEXTURE);
    for (int i = 0; i < builder.fluidTanks.length; i++) {
      drawTexturedModalRect(guiLeft + 179 + 18 * i, guiTop + 145, 0, 54, 16, 47);
    }
View Full Code Here

Examples of edu.ups.gamedev.player.Tank

   *
   * @param tankType
   * @return
   */
  protected Tank createTank(String tankType) {
    Tank tank = null;
    try {
      tank = new Tank(tankType);
    } catch (MalformedURLException murle) {
      ErrorHandler.log("Could not load resource " + tankType);
      ErrorHandler.exit();
    }

View Full Code Here

Examples of edu.ups.gamedev.player.Tank

      switch(type) {
      case NetworkConstants.SPHERE:
        syncManager.register(object, new ColoredSynchronizeCreateMessage(((PlayerSphere) object).getColor()), rate);
        break;
      case NetworkConstants.TANK:
        Tank tank = (Tank) object;
        syncManager.register(object, new TankSynchronizeCreateMessage(tank), rate);
        break;
      case NetworkConstants.TEAPOT:
        Teapot teapot = (Teapot) object;
        syncManager.register(object, new TeapotSynchronizeCreateMessage(teapot), rate);
View Full Code Here

Examples of edu.ups.gamedev.player.Tank

      TankGame.GAMESTATE.getRoot().updateRenderState();
      return p;
    } else if (scm instanceof TankSynchronizeCreateMessage) {
      System.out.println("TankSyncMsg");
      TankSynchronizeCreateMessage msg = (TankSynchronizeCreateMessage) scm;
      Tank tank = null;
      try {
        tank = new Tank(msg);
      } catch (MalformedURLException e) {
        System.err.println("Could not create Tank");
        e.printStackTrace();
        System.exit(1);
      }
     
      TankGame.GAME.lock();
      TankGame.GAMESTATE.getRoot().attachChild(tank);
      TankGame.GAMESTATE.getRoot().updateGeometricState(0, true);
      tank.setRenderQueueMode(Renderer.QUEUE_OPAQUE);
      TankGame.GAMESTATE.getRoot().updateRenderState();
      TankGame.GAME.unlock();
      return tank;
    } else if (scm instanceof TeapotSynchronizeCreateMessage) {
      System.out.println("TeapotSyncMsg");
View Full Code Here

Examples of edu.ups.gamedev.player.Tank

  public NetworkTanksState(boolean isServer, InetAddress serverAddress) {
    super(true);
   
    try {
      localTank = new Tank(Tank.MEDIUM_TANK);
    } catch (MalformedURLException e1) {
      e1.printStackTrace();
      System.exit(1);
    }
    rootNode.attachChild(localTank); //add our sphere to the scenegraph
View Full Code Here

Examples of edu.ups.gamedev.player.Tank

   * @see SimpleGame
   */
  @Override
  protected void simpleInitGame() {
    try {
      localTank = new Tank(Tank.MEDIUM_TANK);
    } catch (MalformedURLException e1) {
      e1.printStackTrace();
      System.exit(1);
    }
    rootNode.attachChild(localTank); //add our sphere to the scenegraph
View Full Code Here

Examples of edu.ups.gamedev.player.Tank

   * @see SimpleGame
   */
  @Override
  protected void simpleInitGame() {
    try {
      localTank = new Tank(Tank.LIGHT_TANK, color.clone()); //our player's light tank with the color chosen by the player
    } catch (MalformedURLException e) {
      System.err.println("Could not create Tank:");
      JOptionPane.showMessageDialog(null, "Could not create tank, exiting program...", "Fatal Error", JOptionPane.ERROR_MESSAGE);
      e.printStackTrace();
      System.exit(1);
View Full Code Here

Examples of edu.ups.gamedev.player.Tank

   * @param obj  the actual <code>Object</code> that is going to be removed
   * @return    <code>true</code> if the <code>Object</code> was removed; <code>
   *         false</code> otherwise
   */
  public boolean remove(SynchronizeRemoveMessage srm, Object obj) {
    Tank tank = (Tank)obj;
    System.out.println("Removing player " + tank.getName());
    return tank.removeFromParent();
  }
View Full Code Here

Examples of edu.ups.gamedev.player.Tank

   * @param color  the color of the <code>Tank</code> to be created
   * @return    the <code>Tank</code> that has been created to represent
   *         a remote player
   */
  private Tank buildRemoteTank(ColorRGBA color) {
    Tank tank;
    try {
      tank = new Tank("remoteTank", color); //create the tank
    } catch (MalformedURLException e) {
      System.err.println("Could not create tank for remote player:");
      e.printStackTrace();
      return null;
    }
    rootNode.attachChild(tank); //attach it to the scene graph
   
    //make sure the material gets applied correctly by forcing a few updates
    rootNode.updateGeometricState(0, true);
    tank.setRenderQueueMode(Renderer.QUEUE_OPAQUE);
    rootNode.updateRenderState();
    return tank;
  }
View Full Code Here
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.