コード例 #1
0
ファイル: Economy.cs プロジェクト: Blinke/Planspelet
        private void SellBook(Genre genre, int index, bool eBook, List<Book> books, Player[] players, Market market, ref int demand)
        {
            int sellChance = rand.Next(0, 101);

            if (books[index].SellChance >= sellChance)
            {
                if (!players[books[index].Owner].BookSold(books[index]))
                    return;

                market.RemoveDemand(genre, eBook, 1, books[index].Owner);
                demand -= 1;

                if (books[index].Stock <= 0 && !eBook)
                    books.RemoveAt(index);
            }
        }