コード例 #1
0
ファイル: Shop.cs プロジェクト: CaileyBianchini/Topia
        public bool SellWithGold(AdvancedPlayer _player, int shopIndex, int playerIndex)
        {
            //Find the item to buy in the inventory array
            Items itemToBuy = _shopInventory[shopIndex];

            //Check to see if the player ourchased the item successfully.
            if (_player.BuyWithGold(itemToBuy, playerIndex))
            {
                //Increase shops gold by item cost to complete the transaction
                _gold += itemToBuy.itemPrice;
                return(true);
            }
            return(false);
        }