示例#1
0
        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();
        }
示例#2
0
        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();
        }
示例#3
0
        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();
        }
示例#4
0
        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();
        }