Package items

Examples of items.Ammo


   */
  @Test
  public void testStoreInitialization(){
    //region 0 with everything available
    assertTrue("Store0 Inventory missing Food", R0Store.getInventory().contains(new Food()));
    assertTrue("Store0 Inventory missing Ammo", R0Store.getInventory().contains(new Ammo()));
    assertTrue("Store0 Inventory missing Water", R0Store.getInventory().contains(new Water()));
    assertTrue("Store0 Inventory missing Medicine", R0Store.getInventory().contains(new Medicine()));
    assertTrue("Store0 Inventory missing Axle", R0Store.getInventory().contains(new Axle()));
    assertTrue("Store0 Inventory missing Clothing", R0Store.getInventory().contains(new Clothing()));
    assertTrue("Store0 Inventory missing Oxen", R0Store.getInventory().contains(new Oxen()));
    assertTrue("Store0 Inventory missing Tongue", R0Store.getInventory().contains(new Tongue()));
    assertTrue("Store0 Inventory missing Wheel", R0Store.getInventory().contains(new Wheel()));
    //region 1 with most things available
    assertTrue("Store1 Inventory missing Food", R1Store.getInventory().contains(new Food()));
    assertTrue("Store1 Inventory missing Ammo", R1Store.getInventory().contains(new Ammo()));
    assertTrue("Store1 Inventory missing Water", R1Store.getInventory().contains(new Water()));
    assertTrue("Store1 Inventory missing Medicine", R1Store.getInventory().contains(new Medicine()));
    assertTrue("Store1 Inventory missing Axle", R1Store.getInventory().contains(new Axle()));
    assertFalse("Store1 Inventory not missing Clothing", R1Store.getInventory().contains(new Clothing()));
    assertTrue("Store1 Inventory missing Oxen", R1Store.getInventory().contains(new Oxen()));
    assertTrue("Store1 Inventory missing Tongue", R1Store.getInventory().contains(new Tongue()));
    assertFalse("Store1 Inventory not missing Wheel", R1Store.getInventory().contains(new Wheel()));
    //region 2 with less available
    assertTrue("Store2 Inventory missing Food", R2Store.getInventory().contains(new Food()));
    assertTrue("Store2 Inventory missing Ammo", R2Store.getInventory().contains(new Ammo()));
    assertFalse("Store2 Inventory not missing Water", R2Store.getInventory().contains(new Water()));
    assertFalse("Store2 Inventory not missing Medicine", R2Store.getInventory().contains(new Medicine()));
    assertTrue("Store2 Inventory missing Axle", R2Store.getInventory().contains(new Axle()));
    assertTrue("Store2 Inventory missing Clothing", R2Store.getInventory().contains(new Clothing()));
    assertFalse("Store2 Inventory not missing Oxen", R2Store.getInventory().contains(new Oxen()));
    assertFalse("Store2 Inventory not missing Tongue", R2Store.getInventory().contains(new Tongue()));
    assertTrue("Store2 Inventory missing Wheel", R2Store.getInventory().contains(new Wheel()));
    //region 3 with almost nothing available
    assertTrue("Store3 Inventory missing Food", R3Store.getInventory().contains(new Food()));
    assertFalse("Store3 Inventory not missing Ammo", R3Store.getInventory().contains(new Ammo()));
    assertFalse("Store3 Inventory not missing Water", R3Store.getInventory().contains(new Water()));
    assertTrue("Store3 Inventory missing Medicine", R3Store.getInventory().contains(new Medicine()));
    assertFalse("Store3 Inventory not missing Axle", R3Store.getInventory().contains(new Axle()));
    assertFalse("Store3 Inventory not missing Clothing", R3Store.getInventory().contains(new Clothing()));
    assertTrue("Store3 Inventory missing Oxen", R3Store.getInventory().contains(new Oxen()));
View Full Code Here


   * Default Constructor for empty game items in Inventory
   */
  public Inventory(){
    length = 9;
    itemInventory = new Item[length];
    itemInventory[0] = new Ammo();
    itemInventory[1] = new Food();
    itemInventory[2] = new Medicine();
    itemInventory[3] = new Water();
    itemInventory[4] = new Axle();
    itemInventory[5] = new Clothing();
View Full Code Here

  /**
   * Returns the Ammo object in the Inventory if it exists, if not returns null
   * @return Ammo or null depending on the presence of a Ammo object in inventory
   */
  public Ammo getAmmo(){
    if(itemInventory[0].equals(new Ammo()))
      return (Ammo) itemInventory[0];
   
    for (int f=0; f<length; f++){
      if (itemInventory[f].equals(new Ammo())){
        return (Ammo) itemInventory[f];
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of items.Ammo

Copyright © 2018 www.massapicom. 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.