예제 #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
  /**
   * Initializes animals, vehicles, and items to world
   *
   * @param world world where animals, vehicles, and items are initialized
   */
  public void initialize(World world) {
    addGrass(world);
    world.addActor(new Gardener());

    addGnats(world);
    addRabbits(world);
    addFoxes(world);

    addSniper(world);
    addHHGTank(world);
    addKnights(world);
    addTrumps(world);
    addBulldozer(world);

    addKillerRabbits(world);
    addHHG(world);
    addMine(world);
    addWall(world);

    // TODO: You may add your own creatures here!
  }