コード例 #1
0
ファイル: Choice.cs プロジェクト: gwenhidwy/RockPaperScissors
		private string DisplayLoss(Choice choiceOne, Choice choiceTwo)
		{
			string output;
			Rules rule = new Rules(choiceTwo, choiceOne);
			output = rule.DisplayWinner();
			return output + "\nPlayer 2 wins!";
		}
コード例 #2
0
 public Game()
 {
     rules = new Rules();
 }
コード例 #3
0
 public static Moves[] DefeatedBy(this Moves move) =>
 Rules
 .Where(r => r.LosingMove == move)
 .Select(r => r.WinningMove)
 .ToArray();
コード例 #4
0
 public static bool Defeats(this Moves move, Moves otherMove) =>
 Rules.Exists(r => r.WinningMove == move && r.LosingMove == otherMove);