public override string landOn(ref Player player) { if (this.setJail == true) { Console.WriteLine("You have gone to jail, you do not pass go you can not collect $200\n"); player.setIsInJail(); player.setLocation(10, false); return base.landOn(ref player) + String.Format(player.getName().ToString() + " has gone to jail!"); } else { if (player.getJailStatis() == true) { if (player.sendMsg == false) { return null; } return base.landOn(ref player) + String.Format(player.getName().ToString() + " is in jail!.."); } return base.landOn(ref player) + String.Format(player.getName().ToString() + " is just visiting!."); } }
public void displayPlayerChoiceMenu(Player player) { if (player.first == true) { int resp = 0; Console.WriteLine("1. Finish turn"); Console.Write("(1-7)>"); //read response resp = inputInteger(); //if response is invalid redisplay menu if (resp == 0) this.displayPlayerChoiceMenu(player); //perform choice according to number input switch (resp) { case 1: //player.first = false; break; } } else { int resp = 0; Console.WriteLine("\n{0}Please make a selection:\n", playerPrompt(player)); Console.WriteLine("1. Finish turn"); Console.WriteLine("2. View your details"); Console.WriteLine("3. Purchase This Property"); Console.WriteLine("4. Buy House for Property"); Console.WriteLine("5. Trade Property with Player"); Console.WriteLine("6. Mortgage Property"); Console.WriteLine("7. Un Mortgage Property"); if (player.getJailStatis() == true && player.first == false) { Console.WriteLine("9. Pay $50 to get out of jail"); } Console.Write("(1-7)>"); //read response resp = inputInteger(); //if response is invalid redisplay menu if (resp == 0) this.displayPlayerChoiceMenu(player); //perform choice according to number input switch (resp) { case 1: //player.first = false; break; case 2: Console.WriteLine("=================================="); Console.WriteLine(player.FullDetailsToString()); Console.WriteLine("=================================="); this.displayPlayerChoiceMenu(player); break; case 3: this.purchaseProperty(player); this.displayPlayerChoiceMenu(player); break; case 4: this.buyHouse(player); this.displayPlayerChoiceMenu(player); break; case 5: this.tradeProperty(player); this.displayPlayerChoiceMenu(player); break; case 6: this.mortgage_property(player); this.displayPlayerChoiceMenu(player); break; case 7: this.un_mortgage_property(player); this.displayPlayerChoiceMenu(player); break; case 8: this.buyHouse(player); this.displayPlayerChoiceMenu(player); break; case 9: player.payJailFine(); break; default: Console.WriteLine("That option is not avaliable. Please try again."); this.displayPlayerChoiceMenu(player); break; } } }