public void TestFetchItem()
        {
            Inv.Put(Itm);
            Item fetchedItm = Inv.Fetch(Itm.FirstID);

            Assert.AreEqual(fetchedItm, Itm);
        }
예제 #2
0
        public GameObject Locate(string id)
        {
            GameObject objectmain = null;

            objectmain = _inventory.Fetch(id);
            return(objectmain);
        }
예제 #3
0
 public void TestFetchItem()
 {
     Inventory test = new Inventory ();
     Item item1 = new Item( new String[] {"shovel", "spade" }, "a shovel", "This is a might fine ..." );
     test.Put(item1);
     Assert.AreEqual (test.Fetch ("shovel"), item1);
 }
예제 #4
0
 public GameObject Locate(string id)
 {
     if (AreYou(id))
     {
         return(this);
     }
     return(_inventory.Fetch(id));
 }
예제 #5
0
        public void TestTakeItem()
        {
            Inventory inv = new Inventory(new string[] { "me", "inventory" }, "Player", "Self");

            inv.Put(new Item(new string[] { "obj1", "tool1" }, "axe", "normally used to cut wood"));
            inv.Take("obj1");

            Item itm = new Item(new string[] { "obj1", "tool1" }, "axe", "normally used to cut wood");

            Assert.AreNotEqual(inv.Fetch("obj1"), itm, "should be not equal");
        }
예제 #6
0
        public void TestFetchItem()
        {
            Inventory inv = new Inventory(new string[] { "me", "inventory" }, "Player", "Self");

            Item itm = new Item(new string[] { "obj1", "tool1" }, "axe", "normally used to cut wood");

            inv.Put(itm);
            Item test = inv.Fetch("obj1");

            Assert.AreEqual(itm, test, "should be same");
        }
예제 #7
0
 public GameObject Locate(string id)
 {
     if (this.AreYou(id))
     {
         return(this);
     }
     else if (_inventory.HasItem(id))
     {
         return(_inventory.Fetch(id));
     }
     return(Location.Locate(id));
 }
        [Test] // FETCH: Returns items it has, and the item remains in the inventory
        public void TestFetchItem()
        {
            Inventory testInventoryObject = new Inventory();
            Item      testItem            = new Item(new string[] { "a TestFirstId", "TestSecondId" }, "TestName", "TestDesc");

            testInventoryObject.Put(testItem);

            Item fetchedItem = testInventoryObject.Fetch("a testfirstid");
            bool actual      = testInventoryObject.HasItem("a testfirstid");
            bool expected    = true;

            Assert.AreEqual(expected, actual, "Item has been fetched and no longer exists in inventory.");
        }
예제 #9
0
        public GameObject Locate(string id)
        {
            GameObject output = null;

            switch (id)
            {
            case "me":
            case "inventory":
                output = this;
                break;

            default:
                output = _inventory.Fetch(id);
                break;
            }

            if (output == null && _currentLocation != null)
            {
                output = _currentLocation.LocationInventory.Fetch(id);
            }

            return(output);
        }
예제 #10
0
 public void TestNoItemFind()
 {
     Assert.AreEqual(_inventory.Fetch("card"), null);
 }