예제 #1
0
파일: Match.cs 프로젝트: dspachos/Edge10RSP
 /// <summary>
 /// Helper function: Displays the available moves.
 /// </summary>
 public void DisplayAvailableMoves()
 {
     WriteLine("Available moves:");
     foreach (var m in this.AvailableMoves)
     {
         WriteLine("{0}. {1}", this.AvailableMoves.IndexOf(m) + 1, m.Label);
     }
     RSPGame.printMainMenuOption();
 }
예제 #2
0
 /// <summary>
 /// Displays the available players
 /// </summary>
 /// <param name="availablePlayersList">Available players list.</param>
 static void DisplayAvailablePlayers(List <Player> availablePlayersList)
 {
     WriteLine("Play againist:");
     foreach (Player p in availablePlayersList)
     {
         WriteLine("{0}. {1}", availablePlayersList.IndexOf(p) + 1, p.PlayerName); // indexOf method performs a linear search; therefore, this method is an O(n) operation which I don't like, but's that ok for now
     }
     RSPGame.printMainMenuOption();
 }