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)); }
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)); }
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)); }
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); } }
public void LocateItem() { Assert.AreEqual(shovel, newInventory.Fetch("shovel")); }