Exemplo n.º 1
0
        public void TestFetchItem()
        {
            inventory = new Inventory();
            inventory.Put(AncientCoin);
            Item actual = inventory.Fetch(AncientCoin.FirstId);

            Assert.AreEqual(AncientCoin, actual, "Returns item and item remains in the inventory");
        }
 public GameObject Locate(string id)
 {
     if (this.AreYou(id))
     {
         return(this);
     }
     return(_inventory.Fetch(id));
 }
Exemplo n.º 3
0
Arquivo: Bag.cs Projeto: bfog/project
 public GameObject Locate(string id)
 {
     if(AreYou(id))
     {
         return this;
     }
     else
     {
         return _inventory.Fetch(id);
     }
 }
        public GameObject Locate(string id)
        {
            if (AreYou(id))
            {
                return(this);
            }
            Item test = _inventory.Fetch(id);

            if (test != null && test.AreYou(id))
            {
                return(test);
            }
            return(_location.Inventory.Fetch(id));
        }
Exemplo n.º 5
0
 public GameObject Locate(string id)
 {
     if (AreYou(id))
     {
         return(this);
     }
     else if (_inventory.HasItem(id))
     {
         return(_inventory.Fetch(id));
     }
     else
     {
         return(_location.Locate(id));
     }
 }
        public GameObject Locate(string id)
        {
            if (this.AreYou(id))
            {
                return(this);
            }

            foreach (Path p in _paths)
            {
                if (p.AreYou(id))
                {
                    return(p);
                }
            }
            return(_inventory.Fetch(id));
        }
Exemplo n.º 7
0
        public GameObject Locate(string id)
        {
            if (this.AreYou(id))
            {
                return(this);
            }

            GameObject item = _inventory.Fetch(id);

            if (item != null)
            {
                return(item);
            }
            if (_location != null)
            {
                item = _location.Locate(id);
                return(item);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 8
0
 public void LocateItem()
 {
     Assert.AreEqual(shovel, newInventory.Fetch("shovel"));
 }