Exemplo n.º 1
0
        public void Should_find_closest_unknown_tile_in_corridors_heading_north_to_south()
        {
            var mapArea = new[]
            {
                "???",
                "# #",
                "# #",
                "# #",
                "# #",
                "???"
            };

            var startPosition = new[]
            {
                "???",
                "# #",
                "#X#",
                "# #",
                "# #",
                "???"
            };

            var expectedPosition = new[]
            {
                "???",
                "#X#",
                "# #",
                "# #",
                "# #",
                "???"
            };

            MapTestHelper.AssertClosestWalkablePosition(mapArea, startPosition, expectedPosition);
        }
Exemplo n.º 2
0
        public void Should_find_closest_unknown_tile_in_rooms()
        {
            var mapArea = new[]
            {
                "#???#",
                "** *****************#",
                "*                  *#",
                "*                  *?",
                "*                   ?",
                "*                  *?",
                "********************#"
            };

            var startPosition = new[]
            {
                "#???#",
                "** *****************#",
                "*                  *#",
                "*            X     *?",
                "*                   ?",
                "*                  *?",
                "********************#"
            };

            var expectedPosition = new[]
            {
                "#???#",
                "** *****************#",
                "*                  *#",
                "*                  *?",
                "*                  X?",
                "*                  *?",
                "********************#"
            };

            MapTestHelper.AssertClosestWalkablePosition(mapArea, startPosition, expectedPosition);
        }
Exemplo n.º 3
0
        public void Should_find_closest_unknown_tile_far_away()
        {
            var mapArea = new[]
            {
                "#####################*******",
                "*****################*     *",
                "*   *######          +     *",
                "*   *###### #########*     *?",
                "*   +       #########*     +?",
                "*   *################*******?",
                "*****"
            };

            var startPosition = new[]
            {
                "#####################*******",
                "*****################*     *",
                "*X  *######          +     *",
                "*   *###### #########*     *?",
                "*   +       #########*     +?",
                "*   *################*******?",
                "*****"
            };

            var expectedPosition = new[]
            {
                "#####################*******",
                "*****################*     *",
                "*   *######          +     *",
                "*   *###### #########*     *?",
                "*   +       #########*     X?",
                "*   *################*******?",
                "*****"
            };

            MapTestHelper.AssertClosestWalkablePosition(mapArea, startPosition, expectedPosition);
        }