public static bool IsValidGameOption(string OptionUser) { int intNumber; if (int.TryParse(OptionUser.ToString(), out intNumber)) { // Console.WriteLine($"It is a number: {intNumber}"); //Validating if its only a if (GameOptions.IsDefined(typeof(GameOptions), intNumber)) { return(true); } else { return(false); } } else { // if (GameOptions.IsDefined(typeof(GameOptions), OptionUser)) { return(true); } else { return(false); } } }