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)."); } }
public RpsPlayer(string playerName, RpsChoicesEnum choice) { PlayerName = playerName; Choice = choice; }