Examples of Health


Examples of com.sun.sgs.service.Node.Health

                             final Health expected)
        throws Exception
    {
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
            public void run() throws Exception {
                Health health = watchdog.getLocalNodeHealth();

                if (health == null) {
                    fail("Expected WatchdogService.getLocalNodeHealth() " +
                          "to return non-null health");
                }
                if (!health.equals(expected)) {
                    fail("Expected WatchdogService.getLocalNodeHealth() " +
                          "to return: " + expected +
                          ", instead received: " + health);
                }
            }
View Full Code Here

Examples of com.sun.sgs.service.Node.Health

                             final Health expected)
        throws Exception
    {
        txnScheduler.runTask(new TestAbstractKernelRunnable() {
            public void run() throws Exception {
                Health health = watchdog.getLocalNodeHealth();

                if (health == null) {
                    fail("Expected WatchdogService.getLocalNodeHealth() " +
                          "to return non-null health");
                }
                if (!health.equals(expected)) {
                    fail("Expected WatchdogService.getLocalNodeHealth() " +
                          "to return: " + expected +
                          ", instead received: " + health);
                }
            }
View Full Code Here

Examples of com.tankz.components.Health

    healthMapper = world.getMapper(Health.class);
  }

  @Override
  protected void process(Entity e) {
    Health health = healthMapper.get(e);
   
    if(!health.isAlive()) {
      world.deleteEntity(e);
    }
   
  }
View Full Code Here

Examples of com.tankz.components.Health

    }
    g.translate(-container.getWidth()+minimapWidth+20,-20);
  }

  private void renderHealth() {
    Health health = healthMapper.get(player);
    g.translate(35, container.getHeight()-45);
    {
      font.drawString(-26, 8, "Health");
      g.rotate(0, 0, -90);
      float healthStatus = health.getHealthStatus();
      g.setDrawMode(Graphics.MODE_ADD);
      statusBar.draw(0,0,statusBar.getWidth()*healthStatus, statusBar.getHeight(), 0,0,statusBar.getWidth()*healthStatus, statusBar.getHeight(), healthStatus<0.25?Color.red:healthStatus<0.6?Color.yellow:Color.green);
      statusBar.draw(statusBar.getWidth()*healthStatus,0,statusBar.getWidth(), statusBar.getHeight(), statusBar.getWidth()*healthStatus,0,statusBar.getWidth(), statusBar.getHeight(), new Color(0.15f,0.15f,0.15f));
      g.setDrawMode(Graphics.MODE_NORMAL);
      g.rotate(0, 0, 90);
View Full Code Here

Examples of com.tankz.components.Health

    g.translate(-cameraSystem.getStartX(), -cameraSystem.getStartY());
  }

  @Override
  protected void process(Entity e) {
    Health health = healthMapper.get(e);
    Physics physics = physicsMapper.get(e);

    float xo = physics.getX()-25;
    float yo = physics.getY()-30;
    g.translate(xo,yo);
    {
      int healthIterations = Math.round(health.getHealthStatus()*10f);
      int i = 0;

      for (i = 0; healthIterations > i; i++) {
        bar.draw(i * 5, 0, healthColor);
      }
View Full Code Here

Examples of com.tankz.components.Health

    world.deleteEntity(bullet);
  }
 
  private void addDamageToTarget(Entity crate) {
    Health h = crate.getComponent(Health.class);
    if(h != null)
      h.addDamage(10f);
  }
View Full Code Here

Examples of com.tankz.components.Health

  }

  public static Entity createCrate(World world, float x, float y, float angleDeg) {
    Entity e = world.createEntity();
    world.getManager(GroupManager.class).add(e, "crates");
    e.addComponent(new Health(100, 160));

    SpatialForm form = new SpatialForm("crate");
    e.addComponent(form);

    Body b = new Body(new Box(50, 50), 0.3f);
View Full Code Here

Examples of com.tankz.components.Health

    e.addComponent(new SpatialForm("mammothTank"));
    e.addComponent(new Velocity());
    e.addComponent(new TurnFactor());
    e.addComponent(new Tower());
    e.addComponent(new Health(110, 150));
    e.addComponent(new Ammo(78, 150));

    Body b = new Body(new Box(125, 104), 1f);
    b.setUserData(e);
    b.setPosition(x, y);
View Full Code Here

Examples of org.spout.vanilla.component.entity.misc.Health

  @Permissible ("vanilla.command.kill")
  public void kill(CommandSource source, CommandArguments args) throws CommandException {
    Player player = args.popPlayerOrMe("player", source);
    args.assertCompletelyParsed();

    Health health = player.get(Health.class);
    if (health == null) {
      throw new CommandException(player.getDisplayName() + " can not be killed.");
    }
    health.kill(HealthChangeCause.COMMAND);
  }
View Full Code Here

Examples of org.spout.vanilla.component.entity.misc.Health

  }

  @Override
  public void onCollided(EntityCollideEvent event) {
    if (event instanceof EntityCollideEntityEvent) {
      Health health = ((EntityCollideEntityEvent) event).getCollided().get(Health.class);
      if (health != null) {
        health.damage(0);
      }
    }
    getOwner().remove();
  }
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.