예제 #1
0
        public GamePanel?GetPanel(Replay replay, GamePanel?current, TimeSpan timer)
        {
            if (timer < TimeSpan.FromMinutes(1))
            {
                return(GamePanel.Talents);
            }

            AnalyzerResult result = analyzer.Analyze(replay, timer.Subtract(TimeSpan.FromSeconds(5)), timer);

            if (result.TeamTalents.Any() && current != GamePanel.Talents)
            {
                return(GamePanel.Talents);
            }
            return(GetNextGamePanel(current, result));
        }
예제 #2
0
        public IEnumerable <StormPlayer> GetPlayers(Replay replay, TimeSpan timer)
        {
            DateTime start = DateTime.Now;

            List <IEnumerable <StormPlayer> > priority = new List <IEnumerable <StormPlayer> >
            {
                Select(analyzer.Analyze(replay, timer, timer.Add(settings.MaxQuintupleTime)), SpectateEvent.QuintupleKill),
                Select(analyzer.Analyze(replay, timer, timer.Add(settings.MaxQuadTime)), SpectateEvent.QuadKill),
                Select(analyzer.Analyze(replay, timer, timer.Add(settings.MaxTripleTime)), SpectateEvent.TripleKill),
                Select(analyzer.Analyze(replay, timer, timer.Add(settings.MaxMultiTime)), SpectateEvent.MultiKill),
                Select(analyzer.Analyze(replay, timer, timer.Add(settings.KillTime)), SpectateEvent.Kill),
                Select(analyzer.Analyze(replay, timer, timer.Add(TimeSpan.FromSeconds(10))), SpectateEvent.Death),
                Select(analyzer.Analyze(replay, timer, timer.Add(TimeSpan.FromSeconds(10))), SpectateEvent.Boss),
                Select(analyzer.Analyze(replay, timer, timer.Add(TimeSpan.FromSeconds(10))), SpectateEvent.Camp),
                Select(analyzer.Analyze(replay, timer, timer.Add(TimeSpan.FromSeconds(10))), SpectateEvent.MapObjective),
                Select(analyzer.Analyze(replay, timer, timer.Add(TimeSpan.FromSeconds(10))), SpectateEvent.TeamObjective),
                Select(analyzer.Analyze(replay, timer, timer.Add(TimeSpan.FromSeconds(5))), SpectateEvent.Unit),
                Select(analyzer.Analyze(replay, timer, timer.Add(TimeSpan.FromSeconds(5))), SpectateEvent.Taunt),
                Select(analyzer.Analyze(replay, timer, timer.Add(TimeSpan.FromSeconds(5))), SpectateEvent.Structure),
                Select(analyzer.Analyze(replay, timer, timer.Add(TimeSpan.FromSeconds(5))), SpectateEvent.Proximity),
                Select(analyzer.Analyze(replay, timer.Subtract(TimeSpan.FromSeconds(5)), timer.Add(TimeSpan.FromSeconds(5))), SpectateEvent.Killer),
                Select(analyzer.Analyze(replay, timer, timer.Add(TimeSpan.FromSeconds(5))), SpectateEvent.Alive)
            };

            IEnumerable <StormPlayer> result = priority.FirstOrDefault(collection => collection.Any()) ?? Enumerable.Empty <StormPlayer>();

            logger.LogDebug("analyze time: " + (DateTime.Now - start));

            return(result);
        }
예제 #3
0
        public void ShouldHave10AliveHeroes(StormReplay stormReplay)
        {
            AnalyzerResult analyzerResult = analyzer.Analyze(stormReplay.Replay, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(30));

            Assert.Equal(10, analyzerResult.Alive.Count());
        }