mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-01-06 18:14:27 -08:00
Implement Rock Scissors Paper (Game 74) in C#
This commit is contained in:
19
74 Rock Scissors Paper/csharp/Choice.cs
Normal file
19
74 Rock Scissors Paper/csharp/Choice.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace RockScissorsPaper
|
||||
{
|
||||
public class Choice
|
||||
{
|
||||
public string Selector {get; private set; }
|
||||
public string Name { get; private set; }
|
||||
internal Choice CanBeat { get; set; }
|
||||
|
||||
public Choice(string selector, string name) {
|
||||
Selector = selector;
|
||||
Name = name;
|
||||
}
|
||||
|
||||
public bool Beats(Choice choice)
|
||||
{
|
||||
return choice == CanBeat;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user