public void Run(TimeSpan frameTime, double remaining) { foreach ((int _, List <IAnimation> queue) in _current) { IAnimation animation = queue.FirstOrDefault(); if (animation == null) { continue; } if (animation.Update(frameTime) || EventScheduler.Turn > animation.Turn + 1) { animation.Cleanup(); queue.Remove(animation); if (animation is MoveAnimation currMove && Game.MapHandler.Field[currMove._source.Pos].IsVisible) { currMove._source.ShouldDraw = true; foreach (IAnimation other in queue) { if (other != animation && other is MoveAnimation nextMove && nextMove._source == currMove._source) { nextMove._source.ShouldDraw = false; nextMove._multmove = false; } } } } } }
public void Update(TimeSpan frameTime, double remaining) { foreach ((int id, List <IAnimation> queue) in _current) { IAnimation animation = queue.FirstOrDefault(); if (animation == null) { continue; } if (animation.Update(frameTime)) { animation.Cleanup(); queue.Remove(animation); } } }