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(); }
/// <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); } }
/// <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 } }
/// <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);