public void RemoveGameItemQuantityFromLocation(GameObjectQuantity selectedGameObjectQuantity) { GameObjectQuantity gameObjectQuantity = _gameObjects.FirstOrDefault(i => i.GameObject.Id == selectedGameObjectQuantity.GameObject.Id); if (gameObjectQuantity != null) { if (selectedGameObjectQuantity.Quantity == 1) { _gameObjects.Remove(gameObjectQuantity); } else { gameObjectQuantity.Quantity--; } } UpdateLocationGameObjects(); }
public void RemoveGameItemQuantityFromInventory(GameObjectQuantity selectedGameObjectQuantity) { GameObjectQuantity gameObjectQuantity = _inventory.FirstOrDefault(i => i.GameObject.Id == selectedGameObjectQuantity.GameObject.Id); if (gameObjectQuantity != null) { if (selectedGameObjectQuantity.Quantity == 1) { _inventory.Remove(gameObjectQuantity); } else { gameObjectQuantity.Quantity--; } } UpdateInventoryCategories(); }
public void AddGameItemQuantityToInventory(GameObjectQuantity selectedGameObjectQuantity) { GameObjectQuantity gameObjectQuantity = _inventory.FirstOrDefault(i => i.GameObject.Id == selectedGameObjectQuantity.GameObject.Id); if (gameObjectQuantity == null) { GameObjectQuantity newGameObjectQuantity = new GameObjectQuantity(); newGameObjectQuantity.GameObject = selectedGameObjectQuantity.GameObject; newGameObjectQuantity.Quantity = 1; _inventory.Add(newGameObjectQuantity); } else { gameObjectQuantity.Quantity++; } UpdateInventoryCategories(); }
public void AddGameObjectQuantityToLocation(GameObjectQuantity selectedGameItemQuantity) { GameObjectQuantity gameObjectQuantity = _gameObjects.FirstOrDefault(i => i.GameObject.Id == selectedGameItemQuantity.GameObject.Id); if (gameObjectQuantity == null) { GameObjectQuantity newGamObjectQuantity = new GameObjectQuantity(); newGamObjectQuantity.GameObject = selectedGameItemQuantity.GameObject; newGamObjectQuantity.Quantity = 1; _gameObjects.Add(newGamObjectQuantity); } else { gameObjectQuantity.Quantity++; } UpdateLocationGameObjects(); }