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