示例#1
0
        private void PayRent(IPlayer player, OwnableSpace ownableSpace)
        {
            var rent = ownableSpace.GetRent();

            banker.Transact(player, ownedSpaces[ownableSpace], rent);
            CheckForBankrupcies();
        }
示例#2
0
 public void Execute(IPlayer player)
 {
     foreach (var payer in players.Where(p => !banker.IsBankrupt(p)))
     {
         banker.Transact(payer, player, 50);
     }
 }
        public void Transact()
        {
            var playerMoney    = banker.Money[player];
            var collectorMoney = banker.Money[collector];

            banker.Transact(player, collector, 50);

            Assert.AreEqual(playerMoney - 50, banker.Money[player]);
            Assert.AreEqual(collectorMoney + 50, banker.Money[collector]);
        }
        public void Execute(IPlayer player)
        {
            var ineligiblePlayers = banker.GetBankrupcies(players);

            players = players.Except(ineligiblePlayers);

            var count = 0;

            while (count < players.Count() && !banker.IsBankrupt(player))
            {
                banker.Transact(player, players.ElementAt(count++), 50);
            }
        }