Exemplo n.º 1
0
        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;
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        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);
                }
            }
        }