/*----- MENU FOR PLAYER WHEN IN JAIL -----*/ public void displayInJailPlayerChoice(Player player) { int resp = 0; Console.WriteLine("\n{0}Please make a selection:\n", playerPrompt(player)); Console.WriteLine("\t1. Attempt to roll doubles to get Released"); Console.WriteLine("\t2. View your details"); Console.WriteLine("\t3. Trade Property with Player"); Console.WriteLine("\t4. Mortgage Property"); Console.WriteLine("\t5. Pay $50"); //read response resp = inputInteger(); //if response is invalid redisplay menu if (resp == 0) this.displayInJailPlayerChoice(player); switch (resp) { case 1: player.hasRolledDoublesInJail(); //this.displayInJailPlayerChoice(player); Console.WriteLine("\n\tPress ENTER to continue"); Console.ReadLine(); break; case 2: Console.WriteLine("\n\t=================================="); Console.WriteLine(player.FullDetailsToString()); Console.WriteLine("\t===================================="); this.displayInJailPlayerChoice(player); break; case 3: this.tradeProperty(player); this.displayInJailPlayerChoice(player); break; case 4: this.mortgageProperty(player); this.displayInJailPlayerChoice(player); break; case 5: player.payFine(); Console.WriteLine("\n\tPress ENTER to continue"); Console.ReadLine(); break; default: Console.WriteLine("\n\tThat option is not available!"); displayInJailPlayerChoice(player); return; } }
public void test_PlayerGettersAndSetters() { Banker theTestBanker = new Banker(); Player theTestPlayer = new Player(); //hasRolledDoubles bool theTestPlayer.get_hasRolledDoubles(); theTestPlayer.is_hasRolledDoubles(); theTestPlayer.hasRolledDoubles = true; theTestPlayer.not_hasRolledDoubles(); //paidFine bool theTestPlayer.getPaidFine(); theTestPlayer.isPaidFine(); theTestPlayer.notPaidFine(); //landedInJailByThreeStraightDoubles bool theTestPlayer.get_LandedInJailByThreeStraightDoubles(); theTestPlayer.not_LandedInJailByThreeStraightDoubles(); theTestPlayer.is_LandedInJailByThreeStraightDoubles(); //inJail bool theTestPlayer.getJailStats(); theTestPlayer.setIsInJail(); theTestPlayer.setNotInJail(); //lastMove int theTestPlayer.getLastMove(); theTestPlayer.getLocation(); theTestPlayer.getName(); theTestPlayer.getPropertiesOwned(); theTestPlayer.getBalance(); theTestPlayer.getBalance(); theTestPlayer.hasRolledDoublesInJail(); theTestPlayer.isNotActive(); theTestPlayer.get_firstTurnInJail(); theTestPlayer.not_firstTurnInJail(); }