Esempio n. 1
0
        static public bool PasendZuVonNuzerParamMissionAcceptFraigaabe(
            this    WindowAgentMissionInfo AusGbsWindowAgentMissionInfo,
            int?AgentLevel,
            SictOptimatParam OptimatParam)
        {
            var VonNuzerParamFürMissionVerhalte = AusGbsWindowAgentMissionInfo.AusVonNuzerParamZuMissionVerhalte(AgentLevel, OptimatParam);

            if (null == VonNuzerParamFürMissionVerhalte)
            {
                return(false);
            }

            return(true == VonNuzerParamFürMissionVerhalte.AktioonAcceptAktiiv);
        }
Esempio n. 2
0
        /// <summary>
        /// </summary>
        /// <param name="MissionInfo"></param>
        /// <returns>
        /// Falls Titel unpasend: null.
        /// Sunsct: Menge aller Faction welce zu MissionObjective und MissionDetails passen.
        /// </returns>
        public SictFactionSictEnum[] ZuMissionMengeFaction(
            WindowAgentMissionInfo MissionInfo)
        {
            if (null == MissionInfo)
            {
                return(null);
            }

            if (!PasendZuTitel(MissionInfo.MissionTitel))
            {
                return(null);
            }

            var MengeFaction = new List <SictFactionSictEnum>();

            if (null != MissionInfo.MengeFaction)
            {
                MengeFaction.AddRange(MissionInfo.MengeFaction);
            }

            return(MengeFaction.Distinct().ToArray());
        }
Esempio n. 3
0
        static public SictKonfigMissionZuMissionFilterVerhalte AusVonNuzerParamZuMissionVerhalte(
            this    WindowAgentMissionInfo AusGbsWindowAgentMissionInfo,
            int?AgentLevel,
            SictOptimatParam OptimatParam)
        {
            if (null == OptimatParam)
            {
                return(null);
            }

            var OptimatParamMission = OptimatParam.Mission;

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

            var ZuMissionFilterVerhalte =
                AusGbsWindowAgentMissionInfo.AusMengeZuMissionFilterVerhalteBestePasende(
                    AgentLevel,
                    OptimatParamMission.MengeZuMissionFilterVerhalte);

            return(ZuMissionFilterVerhalte);
        }
Esempio n. 4
0
        public void Berecne()
        {
            if (null == Htmlstr)
            {
                return;
            }

            HtmlstrSictHtmlNode = HtmlAgilityPack.HtmlNode.CreateNode(Htmlstr);

            if (null == HtmlstrSictHtmlNode)
            {
                return;
            }

            HtmlHtmlNode = HtmlstrSictHtmlNode.SelectSingleNode("/html");

            if (null == HtmlHtmlNode)
            {
                return;
            }

            var ListeNodeSpanSuuce = HtmlHtmlNode.SelectNodes("//span");

            /*
             * 2014.00.09	Beobactung:
             * In mance Variante kome kaine span vor.
             *
             * if(null	== ListeNodeSpanSuuce)
             * {
             *      return;
             * }
             * */

            var ListeNodeSpan = (null == ListeNodeSpanSuuce) ? null : ListeNodeSpanSuuce.ToArray();

            HtmlNodeMissionBriefingTitel =
                (null == ListeNodeSpan) ? null :
                ListeNodeSpan.FirstOrDefault((Kandidaat) => Regex.Match(Kandidaat.InnerText ?? "", "Mission briefing", RegexOptions.IgnoreCase).Success);

            if (null != HtmlNodeMissionBriefingTitel)
            {
                HtmlNodeMissionBriefingText = Optimat.Glob.SelectSingleNodeNaacNode(
                    HtmlHtmlNode,
                    "//div",
                    HtmlNodeMissionBriefingTitel);
            }

            if (VarianteAgentConvLeftPane)
            {
                //	Hiir mus noc geändert were, diise Annaame füürt dazu das der MissionBriefing Text anders ausfält als aus dem AgentBrowser Window
                HtmlNodeMissionBriefingText = HtmlHtmlNode.SelectSingleNode("//body");

                AgentConvPortraitImgHtmlNode = HtmlHtmlNode.SelectSingleNode("//img[starts-with(@src, 'portrait')]");

                if (null != AgentConvPortraitImgHtmlNode)
                {
                    AgentConvPortraitTdHtmlNode = AgentConvPortraitImgHtmlNode.ParentNode;
                }

                if (null != AgentConvPortraitTdHtmlNode)
                {
                    AgentConvLocationTdHtmlNode = Optimat.Glob.SelectSingleNodeNaacNode(AgentConvPortraitTdHtmlNode.ParentNode, "/td", AgentConvPortraitTdHtmlNode);
                }

                if (null != AgentConvLocationTdHtmlNode)
                {
                    AgentConvAgentNameHtmlNode = Optimat.Glob.SelectSingleNodeNaacNodeMitZuusazFilter(
                        AgentConvLocationTdHtmlNode,
                        "/font", null, (KandidaatNode) => (KandidaatNode.GetAttributeValue("color", "") ?? "").Length < 4);
                }

                if (null != AgentConvAgentNameHtmlNode)
                {
                    var AgentConvAgentShowInfoHtmlNode =
                        Optimat.Glob.SelectSingleNodeNaacNodeMitZuusazFilter(
                            AgentConvLocationTdHtmlNode, "/a", AgentConvAgentNameHtmlNode,
                            (KandidaatNode) => !Optimat.Glob.SelectNodesPerXPath(KandidaatNode, "/img").IsNullOrEmpty());

                    AgentConvLocationMengeHtmlNode =
                        Optimat.Glob.SelectNodesNaacNode(AgentConvLocationTdHtmlNode, "/*", AgentConvAgentShowInfoHtmlNode);
                }

                if (null != AgentConvLocationMengeHtmlNode)
                {
                    var AgentLocationAuswert = new SictAuswertGbsMissionLocationAusHtmlNodeUndSiblings(AgentConvLocationMengeHtmlNode);
                    AgentLocationAuswert.Berecne();

                    AgentLocation = AgentLocationAuswert.Ergeebnis;
                }
            }

            if (null != HtmlNodeMissionBriefingText)
            {
                MissionBriefingText = HtmlNodeMissionBriefingText.InnerText;
            }

            {
                /*
                 * 2013.09.01
                 * Ersaz Suuce HtmlNodeTitelObjective:
                 * Suuce sol sowool fer HtmlStr aus Agent Conversation als auc HtmlStr aus Read Details funktioniire:
                 *
                 * 2013.09.01 Bsp aus Agent Conversation:
                 * "<span id=subheader><font>The Missing Convoy Objectives</font></span><br>"
                 *
                 * 2013.09.01 Bsp aus Read Details:
                 * "<span id=Span2><font>The Missing Convoy Objectives</font></span><br>"
                 *
                 * HtmlNodeTitelObjective = HtmlstrSictHtmlNode.SelectSingleNode("//span[@id='subheader']");
                 *
                 * if (null != HtmlNodeTitelObjective)
                 * {
                 *      TitelObjectiveText = HtmlNodeTitelObjective.InnerText;
                 * }
                 *
                 * */

                if (null != ListeNodeSpan)
                {
                    foreach (var NodeSpan in ListeNodeSpan)
                    {
                        var NodeSpanInnerText = NodeSpan.InnerText;

                        if (null == NodeSpanInnerText)
                        {
                            continue;
                        }

                        var TitelObjectiveMatch = Regex.Match(NodeSpanInnerText, TitelObjectiveRegexPattern);

                        if (!TitelObjectiveMatch.Success)
                        {
                            continue;
                        }

                        HtmlNodeTitelObjective = NodeSpan;

                        TitelObjectiveText = NodeSpanInnerText;

                        MissionTitel = TitelObjectiveMatch.Groups[1].Value.Trim();

                        TitelObjectiveTextTailNaacObjective = TitelObjectiveText.Substring(TitelObjectiveMatch.Index + TitelObjectiveMatch.Length);

                        Complete = Regex.Match(TitelObjectiveTextTailNaacObjective, "complete", RegexOptions.IgnoreCase).Success;

                        break;
                    }
                }
            }

            if (null != TitelObjectiveText)
            {
                MengeObjectiveKandidaatCaptionHtmlNode =
                    Optimat.Glob.SelectNodesNaacNode(
                        HtmlHtmlNode,
                        "//span[@id='caption' and contains(text(), 'Objective')]",
                        HtmlNodeTitelObjective);

                if (null != MengeObjectiveKandidaatCaptionHtmlNode)
                {
                    MengeObjectiveAuswert =
                        MengeObjectiveKandidaatCaptionHtmlNode
                        .Select((Node) =>
                    {
                        var Auswert = new SictAuswertGbsAgentDialogueMissionObjectiveAusHtmlNodeCaption(Node);
                        Auswert.Berecne();
                        return(Auswert);
                    }).ToArray();
                }
            }

            if (null != HtmlNodeTitelObjective)
            {
                HtmlNodeTitelReward =
                    Optimat.Glob.SelectSingleNodeNaacNodeMitZuusazFilter(
                        HtmlHtmlNode,
                        "//span",
                        HtmlNodeTitelObjective,
                        (Node) => Regex.Match(Node.InnerText, "Rewards", RegexOptions.IgnoreCase).Success);

                if (null != HtmlNodeTitelReward)
                {
                    var RewardIskBetraagStringNodeUndMatch =
                        Optimat.Glob.SelectSingleNodeNaacNodeMitInnerTextRegexPattern(
                            HtmlHtmlNode,
                            "//td",
                            HtmlNodeTitelReward,
                            RewardIskRegexPattern,
                            RegexOptions.IgnoreCase);

                    var RewardLpBetraagStringNodeUndMatch =
                        Optimat.Glob.SelectSingleNodeNaacNodeMitInnerTextRegexPattern(
                            HtmlHtmlNode,
                            "//td",
                            HtmlNodeTitelReward,
                            RewardLpRegexPattern,
                            RegexOptions.IgnoreCase);

                    if (null != RewardIskBetraagStringNodeUndMatch.Value)
                    {
                        RewardIskBetraagString = RewardIskBetraagStringNodeUndMatch.Value.Groups[1].Value;
                    }

                    if (null != RewardLpBetraagStringNodeUndMatch.Value)
                    {
                        RewardLpBetraagString = RewardLpBetraagStringNodeUndMatch.Value.Groups[1].Value;
                    }

                    HtmlNodeTitelBonusReward =
                        Optimat.Glob.SelectSingleNodeNaacNodeMitZuusazFilter(
                            HtmlHtmlNode,
                            "//span",
                            HtmlNodeTitelObjective,
                            (Node) => Regex.Match(Node.InnerText, "Bonus.*Rewards", RegexOptions.IgnoreCase).Success);

                    if (null != HtmlNodeTitelBonusReward)
                    {
                        var BonusRewardIskBetraagStringNodeUndMatch =
                            Optimat.Glob.SelectSingleNodeNaacNodeMitInnerTextRegexPattern(
                                HtmlHtmlNode,
                                "//td",
                                HtmlNodeTitelBonusReward,
                                RewardIskRegexPattern,
                                RegexOptions.IgnoreCase);

                        if (null != BonusRewardIskBetraagStringNodeUndMatch.Value)
                        {
                            BonusRewardIskBetraagString = BonusRewardIskBetraagStringNodeUndMatch.Value.Groups[1].Value;
                        }
                    }
                }
            }

            /*
             * 2015.02.07
             *
             * Ergeebnis.Htmlstr = Htmlstr;
             *
             * Ergeebnis.MissionTitel = MissionTitel;
             * Ergeebnis.Complete = Complete;
             *
             * Ergeebnis.RewardIskAnzaal = (int?)AuswertGbs.Glob.SctandardNumberFormatZaalBetraag(RewardIskBetraagString);
             * Ergeebnis.RewardLpAnzaal = (int?)AuswertGbs.Glob.SctandardNumberFormatZaalBetraag(RewardLpBetraagString);
             * Ergeebnis.BonusRewardIskAnzaal	 = (int?)AuswertGbs.Glob.SctandardNumberFormatZaalBetraag(BonusRewardIskBetraagString);
             * */

            var RewardIskAnzaal      = (int?)TempAuswertGbs.Extension.SctandardNumberFormatZaalBetraag(RewardIskBetraagString);
            var RewardLpAnzaal       = (int?)TempAuswertGbs.Extension.SctandardNumberFormatZaalBetraag(RewardLpBetraagString);
            var BonusRewardIskAnzaal = (int?)TempAuswertGbs.Extension.SctandardNumberFormatZaalBetraag(BonusRewardIskBetraagString);

            if (RewardIskAnzaal.HasValue)
            {
                if (!BonusRewardIskAnzaal.HasValue)
                {
                    BonusRewardIskAnzaal = 0;
                }

                if (!RewardLpAnzaal.HasValue)
                {
                    RewardLpAnzaal = 0;
                }
            }

            WindowAgentMissionObjectiveObjective Objective = null;

            if (null != MengeObjectiveAuswert)
            {
                var MengeObjective = MengeObjectiveAuswert.Select((Auswert) => Auswert.Ergeebnis).ToArray();

                var SecurityLevelMinimumMili =
                    Optimat.EveOnline.Extension.SecurityLevelMinimumMiliBerecne(MengeObjective);

                Objective =
                    new WindowAgentMissionObjectiveObjective(
                        MengeObjective: MengeObjective,
                        AgregatioonComplete: Optimat.EveOnline.Extension.MissionObjectiveCompleteBerecne(MengeObjective, Complete),
                        SecurityLevelMinimumMili: SecurityLevelMinimumMili);
            }

            var MengeFaction = MengeFactionBerecneAusHtml(Htmlstr);

            var Ergeebnis = new WindowAgentMissionInfo(
                MissionTitel,
                Objective,
                MengeFaction,
                Complete,
                RewardIskAnzaal,
                RewardLpAnzaal,
                BonusRewardIskAnzaal
                //	2015.02.13	,MissionBriefingText
                );

            this.Ergeebnis = Ergeebnis;
        }
Esempio n. 5
0
        static public SictKonfigMissionZuMissionFilterVerhalte AusMengeZuMissionFilterVerhalteBestePasende(
            this    WindowAgentMissionInfo AusGbsWindowAgentMissionInfo,
            int?AgentLevel,
            IEnumerable <SictKonfigMissionZuMissionFilterVerhalte> MengeZuMissionFilterVerhalte)
        {
            if (null == MengeZuMissionFilterVerhalte)
            {
                return(null);
            }

            var MissionTitel = AusGbsWindowAgentMissionInfo.MissionTitel;

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

            var MengeKandidaatFilterMissionTitelPasend =
                MengeZuMissionFilterVerhalte
                .Where((Kandidaat) =>
            {
                var FilterMissionTitelRegexPattern = Kandidaat.FilterMissionTitelRegexPattern;

                if (null == FilterMissionTitelRegexPattern)
                {
                    return(false);
                }

                var MissionTitelMatch = Regex.Match(MissionTitel, FilterMissionTitelRegexPattern);

                return(MissionTitelMatch.Success);
            })
                .ToArray();

            var FundAgentLevelGlaic =
                MengeKandidaatFilterMissionTitelPasend
                .FirstOrDefault((Kandidaat) =>
            {
                var FilterAgentLevel = Kandidaat.FilterAgentLevel;

                if (!FilterAgentLevel.HasValue)
                {
                    return(false);
                }

                if (!((int)(FilterAgentLevel.Value) == AgentLevel))
                {
                    return(false);
                }

                return(true);
            });

            if (null != FundAgentLevelGlaic)
            {
                return(FundAgentLevelGlaic);
            }

            var FundAgentLevelAny =
                MengeKandidaatFilterMissionTitelPasend
                .FirstOrDefault((Kandidaat) =>
            {
                var FilterAgentLevel = Kandidaat.FilterAgentLevel;

                return(FilterAgentLevel == SictAgentLevelOderAnySictEnum.Any);
            });

            return(FundAgentLevelAny);
        }