public string TakeItemFrom(Player p, string thingId, IHaveInventory container)
        {
            if (container.Locate(thingId) != null)
            {
                Item _item = container.Take(thingId) as Item;
                if (_item == null)
                {
                    return("Could not take " + thingId);
                }
                p.Inventory.Put(_item);

                return("You have taken the " + thingId + ".\r\n");
            }
            return("Could not find " + thingId);
        }
Exemplo n.º 2
0
        private String TakeItemFrom(Player p, string thingId, IHaveInventory container)
        {
            if (container.Locate(thingId) == null)
            {
                return("Could not find " + thingId + "\r\n");
            }

            GameObject _itemFound  = container.Locate(thingId);
            Item       itemGrabbed = container.Take(thingId) as Item;

            if (itemGrabbed == null)
            {
                return("You can't take " + _itemFound.ShortDescription + " with you.\r\n");
            }
            p.Inventory.Put(itemGrabbed);

            return("You have taken the " + thingId + ".\r\n");
        }
 private GameObject PickUp(IHaveInventory container, string id)
 {
     return(container.Take(id));
 }
Exemplo n.º 4
0
 GameObject Pickup(string id, IHaveInventory container)
 {
     return(container.Take(id));
 }