public void RemoveItemFromInventory() { // // confirm a game item selected and is in inventory // subtract from inventory and add to location // if (_currentGameObject != null) { // // cast selected game item // GameObjectQuantity selectedGameObjectQuantity = _currentGameObject as GameObjectQuantity; _currentLocation.AddGameObjectQuantityToLocation(selectedGameObjectQuantity); _player.RemoveGameItemQuantityFromInventory(selectedGameObjectQuantity); } }
public void AddObjectToInventory() { // // confirm a game item selected and is in current location // subtract from location and add to inventory // if (_currentGameObject != null && _currentLocation.GameObjects.Contains(_currentGameObject)) { // // cast selected game item // GameObjectQuantity selectedGameItemQuantity = _currentGameObject as GameObjectQuantity; _currentLocation.RemoveGameItemQuantityFromLocation(selectedGameItemQuantity); _player.AddGameItemQuantityToInventory(selectedGameItemQuantity); } }