-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRules.cs
46 lines (42 loc) · 1.17 KB
/
Rules.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Text;
namespace Jokenpo
{
public class RockRules: AbstractRules
{
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 class PaperRules : AbstractRules
{
public override GameResult WinAgainst(HandForm oponent)
{
if (oponent == HandForm.Scissor)
return GameResult.Lose;
else if (oponent == HandForm.Rock)
return GameResult.Win;
else
return GameResult.Tie;
}
}
public class ScissorRules : AbstractRules
{
public override GameResult WinAgainst(HandForm oponent)
{
if (oponent == HandForm.Rock)
return GameResult.Lose;
else if (oponent == HandForm.Paper)
return GameResult.Win;
else
return GameResult.Tie;
}
}
}