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); } }
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"); } }
public abstract GameResult WinAgainst(HandForm opponent);