Ejemplo n.º 1
0
        public void FetchItemTest()
        {
            Item      TestItem      = new Item(new string[] { "potato", "baked" }, "baked potato", "a baked potato");
            Inventory TestInventory = new Inventory();

            TestInventory.PutItem(TestItem);
            Assert.IsTrue(TestInventory.FetchItem("baked") == TestItem);

            Assert.IsTrue(TestInventory.HasItem("baked"));
        }
Ejemplo n.º 2
0
        public void FetchItemTest()
        {
            Item TestItem = new Item (new string[] { "potato", "baked" }, "baked potato", "a baked potato");
            Inventory TestInventory = new Inventory ();

            TestInventory.PutItem (TestItem);
            Assert.IsTrue (TestInventory.FetchItem ("baked") == TestItem);

            Assert.IsTrue (TestInventory.HasItem ("baked"));
        }
Ejemplo n.º 3
0
        public GameObject Locate(string id)
        {
            if (this.AreYou(id) == true)
            {
                return(this);
            }
            else if (_inventory.HasItem(id) == true)
            {
                return(_inventory.FetchItem(id));
            }

            return(null);
        }