Exemple #1
0
 private void ShowActions(Player player, BoardSpace space)
 {
     if (space is Property prop)
     {
         var options = new List <string>();
         var action  = PromptMemberOf($"Enter action for {prop.Name}", new List <string>
         {
             "None",
             "Buy a house"
         });
         if (action == "Buy a house")
         {
             if (prop.CanAddHouse())
             {
                 player.Charge(prop.HouseCost);
                 player.NumHouses++;
                 prop.NumHouses++;
             }
             else
             {
                 Console.WriteLine("Can't add a house!");
             }
         }
     }
 }
 public override void OnPlayerLanded(Player player, int numberRolled)
 {
     base.OnPlayerLanded(player, numberRolled);
     if (player != Owner && Owner != null && !Owner.InJail)
     {
         var rent = CalculateRent(player);
         player.Charge(rent);
         // *Added code*
         player.Board.dataCollector.registerMove(new Move(player, this, rent, numberRolled));
         // *Added code*
         Owner.Gain(rent);
         player.Interacter.ShowPlayerPaidRent(player, Owner, this, rent);
     }
     else if (Owner == null)
     {
         if (player.Interacter.CheckPlayerBuy(player, this, Cost))
         {
             Owner = player;
             player.AddProperty(this);
         }
     }
 }
 public override void OnPlayerLanded(Player player, int numberRolled)
 {
     base.OnPlayerLanded(player, numberRolled);
     player.Charge(Tax);
     player.Interacter.ShowTaxed(player, this);
 }