Exemplo n.º 1
0
        private void HandleMoves(Sequence sequence)
        {
            for (int m = 0; m < sequence.Times; ++m)
            {
                // although it can go multiple fields we need it just to move one field
                Turtle.Move();

                var collidedWith = collision.Check(Turtle);

                if (collidedWith == null)
                {
                    logger.Info($"Success!");

                    continue;
                }

                collidedWith.Handle(logger, Turtle);

                if (Turtle.Dead || Turtle.Exited)
                {
                    break;
                }
            }
        }