Ejemplo n.º 1
0
 public override GameResult WinAgainst(HandForm oponent)
 {
     if (oponent == HandForm.Paper)
     {
         return(GameResult.Lose);
     }
     else if (oponent == HandForm.Scissor)
     {
         return(GameResult.Win);
     }
     else
     {
         return(GameResult.Tie);
     }
 }
Ejemplo n.º 2
0
 public static AbstractRules ToRule(this HandForm handForm)
 {
     if (handForm == HandForm.Rock)
     {
         return(new RockRules());
     }
     else if (handForm == HandForm.Paper)
     {
         return(new PaperRules());
     }
     else if (handForm == HandForm.Scissor)
     {
         return(new ScissorRules());
     }
     else
     {
         throw new ArgumentException("There is no hand form rule for this option");
     }
 }
Ejemplo n.º 3
0
 public abstract GameResult WinAgainst(HandForm opponent);