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); } }
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); }