Пример #1
0
        private void GlimpseCalculation()
        {
            var enemyHeroes = EntityManager <Hero> .Entities.Where(x => x.IsValid && !x.IsIllusion && x.Team != Owner.Team);

            var time = Math.Round(Game.RawGameTime, 2);

            foreach (var hero in enemyHeroes)
            {
                var container = Timer.Find(x => x.Owner.Equals(hero));
                if (container == null)
                {
                    container = new TimeContainer(hero, Config.SuperFastMode);
                    Timer.Add(container);
                }
                container.Update(time);
            }
        }
Пример #2
0
        private Vector3 GetClosestPosition(TimeContainer container)
        {
            double dif          = 0;
            var    currentTime  = Game.RawGameTime;
            var    exitPosition = new Vector3();

            foreach (var cont in container.Positions)
            {
                var time     = cont.Key;
                var localDif = Math.Abs(currentTime - time);
                if (localDif <= dif)
                {
                    exitPosition = container.Positions[time];
                    dif          = localDif;
                }
            }
            return(exitPosition);
        }