private bool ParseAreaName(PgNpc item, object value, string parsedFile, string parsedKey) { if (!(value is string ValueKey)) { return(Program.ReportFailure(parsedFile, parsedKey, $"Value '{value}' was expected to be a string")); } if (!ValueKey.StartsWith("Area")) { return(Program.ReportFailure(parsedFile, parsedKey, $"Invalid area name '{ValueKey}'")); } string ValueAreaName = ValueKey.Substring(4); return(StringToEnumConversion <MapAreaName> .SetEnum((MapAreaName valueEnum) => item.AreaName = valueEnum, ValueAreaName)); }