Examples of Treasure


Examples of cz.cuni.mff.abacs.burglar.logics.objects.items.Treasure

  private static Item getTreasure(Element treasureElement, DataMap map) {
    // get the attributes:       
    int id = XMLBase.getIntAttrOrZero(treasureElement, STR_ID);
   
    // create the object:
    Item item = new Treasure(id, map);
   
    return item;
  }
View Full Code Here

Examples of game.entity.Treasure

    sellTurretLocations = new HashSet<Point>();
  }

  public void update()
  {
    Treasure treasure = (Treasure)world.getEntity(world.getEntitiesByType(EntityType.Treasure).iterator().next());
    int gold = treasure.getGold();

    // sell wall
    for(Point sellWallLocation : sellWallLocations)
    {
      int x = sellWallLocation.getX();
      int y = sellWallLocation.getY();
      Set<Long> results = world.getEntitiesByLocation(x,y);
      results.retainAll(world.getEntitiesByType(EntityType.Wall));

      if(!results.isEmpty())
      {
        treasure.setGold(treasure.getGold() + (int)(wallCost * refundPercentage));
        Long id = results.iterator().next();
        world.deleteEntity(id);
      }
    }
    sellWallLocations.clear();

    // sell turrets
    for(Point sellTurretLocation : sellTurretLocations)
    {
      int x = sellTurretLocation.getX();
      int y = sellTurretLocation.getY();
      Set<Long> results = world.getEntitiesByLocation(x,y);
      results.retainAll(world.getEntitiesByType(EntityType.Turret));

      if(!results.isEmpty())
      {
        treasure.setGold(treasure.getGold() + (int)(turretCost * refundPercentage));
        Long id = results.iterator().next();
        world.deleteEntity(id);
      }
    }
    sellTurretLocations.clear();

    // build wall
    for(Point createWallLocation : createWallLocations)
    {
      int x = createWallLocation.getX();
      int y = createWallLocation.getY();
      if((gold >= wallCost) && world.getEntitiesByLocation(x,y).isEmpty())
      {
        treasure.setGold(gold - wallCost);
        world.createEntity(EntityType.Wall, x, y, Direction.North);
      }
    }
    createWallLocations.clear();

    // build turret
       for(Point createTurretLocation : createTurretLocations)
    {
      int x = createTurretLocation.getX();
      int y = createTurretLocation.getY();
      if((gold >= turretCost) && world.getEntitiesByLocation(x,y).isEmpty())
      {
        treasure.setGold(gold - turretCost);
        world.createEntity(EntityType.Turret, x, y, Direction.North);
      }
    }
    createTurretLocations.clear();
  }
View Full Code Here

Examples of net.coljac.pirates.Treasure

        it.remove();
      }
    }
    for(String line: lines) {
      String[] tokens = line.split("\t");
      Card treasure = new Treasure();
      treasure.setExpansion("Pirates of the " + tokens[1]);
      treasure.setName(tokens[3]);
      treasure.setPoints(0);
      treasure.setRarity(tokens[2]);
      treasure.setRules(tokens[4]);
      treasure.setNumber(tokens[0]);
      db.getCards().add(treasure);
    }

    db.save();
  }
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.