Пример #1
0
 static void Main(string[] args)
 {
     Player kyle = new Player();
     while (true)
     {
         int first = kyle.RollDice()[0];
         int second = kyle.RollDice()[1];
         Console.WriteLine(first + " " + second);
         Thread.Sleep(90);
     }
     Console.ReadLine();
 }
Пример #2
0
 /// <summary>
 /// Action taken when a player lands on 
 /// this property
 /// </summary>
 /// <param name="player"></param>
 public override void IsLandedOnBy(Player player)
 {
     // Pay owner rent if owned
     if (this.isOwned)
     {
         player.MustPay(this.owner, this.rent);
     }
     // Otherwise lander can buy
     else
     {
         player.MayBuy(this);
     }
 }
Пример #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="opponent">Player to which money is owed</param>
 public void MustPay(Player opponent, int amt)
 {
     if (this.wealth > amt)
     {
         this.wealth -= amt;
         opponent.wealth += amt;
     }
     else
     {
         // Attempt to sell houses or
         // mortgage houses to pay debt
         // Will require AI decision making
     }
 }
Пример #4
0
 /// <summary>
 /// Action when a space on the board
 /// is landed on
 /// </summary>
 /// <param name="player">Player who lands on the board</param>
 public abstract void IsLandedOnBy(Player player);