コード例 #1
0
 /*
  * Add HolyHandGrenades to world
  */
 private void addHHG(World world) {
   for (int i = 0; i < INITIAL_HHG; i++) {
     Location loc = Util.getRandomEmptyLocation(world);
     HolyHandGrenade hhg = new HolyHandGrenade(loc);
     world.addItem(hhg);
     world.addActor(hhg);
   }
 }
コード例 #2
0
 /*
  * Add HolyHandGrenade Tanks to world
  */
 private void addHHGTank(World world) {
   for (int i = 0; i < INITIAL_HHGTANK; i++) {
     Location loc = Util.getRandomEmptyLocation(world);
     HolyGrenadeTank tank = new HolyGrenadeTank(loc);
     world.addItem(tank);
     world.addActor(tank);
   }
 }
コード例 #3
0
 /*
  * Add Mines to world
  */
 private void addMine(World world) {
   for (int i = 0; i < INITIAL_MINE; i++) {
     Location loc = Util.getRandomEmptyLocation(world);
     Mine mine = new Mine(loc);
     world.addItem(mine);
     world.addActor(mine);
   }
 }
コード例 #4
0
 /*
  * Add Gnats to world
  */
 private void addGnats(World world) {
   for (int i = 0; i < INITIAL_GNATS; i++) {
     Location loc = Util.getRandomEmptyLocation(world);
     Gnat gnat = new Gnat(loc);
     world.addItem(gnat);
     world.addActor(gnat);
   }
 }
コード例 #5
0
 /*
  * Add KillerRabbits to world
  */
 private void addKillerRabbits(World world) {
   KillerRabbitAI killerRabbitAI = new KillerRabbitAI();
   for (int i = 0; i < INITIAL_KILLER_RABBITS; i++) {
     Location loc = Util.getRandomEmptyLocation(world);
     KillerRabbit caerbonnog = new KillerRabbit(killerRabbitAI, loc);
     world.addItem(caerbonnog);
     world.addActor(caerbonnog);
   }
 }
コード例 #6
0
  /*
   * Add Bulldozers to world
   */
  private void addBulldozer(World world) {

    for (int i = 0; i < INITIAL_BULLDOZER; i++) {
      Location loc = Util.getRandomEmptyLocation(world);
      Bulldozer bulldozer = new Bulldozer(loc);
      world.addItem(bulldozer);
      world.addActor(bulldozer);
    }
  }
コード例 #7
0
  /*
   * Add Donald Trumps to world
   */
  private void addTrumps(World world) {

    for (int i = 0; i < INITIAL_TRUMPS; i++) {
      Location loc = Util.getRandomEmptyLocation(world);
      DonaldTrump trump = new DonaldTrump(loc);
      world.addItem(trump);
      world.addActor(trump);
    }
  }
コード例 #8
0
 /*
  * Add Sniper to world
  */
 private void addSniper(World world) {
   SniperAI sniperAI = new SniperAI();
   for (int i = 0; i < INITIAL_SNIPERS; i++) {
     Location loc = Util.getRandomEmptyLocation(world);
     Sniper sniper = new Sniper(sniperAI, loc);
     world.addItem(sniper);
     world.addActor(sniper);
   }
 }
コード例 #9
0
 /*
  * Add Knights to world
  */
 private void addKnights(World world) {
   KnightAI knightAI = new KnightAI();
   for (int i = 0; i < INITIAL_KNIGHTS; i++) {
     Location loc = Util.getRandomEmptyLocation(world);
     Knight knight = new Knight(knightAI, loc);
     world.addItem(knight);
     world.addActor(knight);
   }
 }
コード例 #10
0
 /*
  * Add Rabbits to world
  */
 private void addRabbits(World world) {
   RabbitAI rabbitAI = new RabbitAI();
   for (int i = 0; i < INITIAL_RABBITS; i++) {
     Location loc = Util.getRandomEmptyLocation(world);
     Rabbit rabbit = new Rabbit(rabbitAI, loc);
     world.addItem(rabbit);
     world.addActor(rabbit);
   }
 }
コード例 #11
0
 /*
  * Add Foxes to world
  */
 private void addFoxes(World world) {
   FoxAI foxAI = new FoxAI();
   for (int i = 0; i < INITIAL_FOXES; i++) {
     Location loc = Util.getRandomEmptyLocation(world);
     Fox fox = new Fox(foxAI, loc);
     world.addItem(fox);
     world.addActor(fox);
   }
 }
コード例 #12
0
 /*
  * Add wall to world
  */
 private void addWall(World world) {
   for (int i = 0; i < INITIAL_WALL; i++) {
     Location loc = Util.getRandomEmptyLocation(world);
     world.addItem(new Wall(loc));
   }
 }
コード例 #13
0
 /*
  * Add grass to world
  */
 private void addGrass(World world) {
   for (int i = 0; i < INITIAL_GRASS; i++) {
     Location loc = Util.getRandomEmptyLocation(world);
     world.addItem(new Grass(loc));
   }
 }