Ejemplo n.º 1
0
        public RpsPlayer(string playerName, string choice)
        {
            PlayerName = playerName;
            RpsChoicesEnum enumChoice;

            if (RpsChoicesEnum.TryParse(choice, true, out enumChoice))
            {
                Choice = enumChoice;
            }
            else
            {
                throw new NoSuchStrategyException("Please choose a valid game move (R, P or S).");
            }
        }
Ejemplo n.º 2
0
 public RpsPlayer(string playerName, RpsChoicesEnum choice)
 {
     PlayerName = playerName;
     Choice     = choice;
 }