Пример #1
0
        static public OreTypeEnum?ExtractAsteroidOreType(
            this ShipUiTarget Target,
            out string OreTypeString)
        {
            OreTypeString = null;

            var LabelAggregatedLessXml =
                Target?.LabelText?.Select(Label => Label?.Text)?.StringJoin(" ")?.RemoveXmlTag()?.Trim();

            if (null == LabelAggregatedLessXml)
            {
                return(null);
            }

            var Match = Regex.Match(
                LabelAggregatedLessXml, TargetLabelAsteroidRegexPattern, RegexOptions.IgnoreCase);

            if (!Match.Success)
            {
                return(null);
            }

            OreTypeString = Match.Groups[1].Value.Trim();

            return(OreTypeString.AsOreTypeEnum());
        }
Пример #2
0
        static public OreTypeEnum?ExtractAsteroidOreType(this ShipUiTarget Target)
        {
            string OreTypeString;

            return(ExtractAsteroidOreType(Target, out OreTypeString));
        }