コード例 #1
0
        public void TestPathfinderTeleportDefaultCase()
        {
            PathFinder pathFinder = new PathFinder(new byte[, ]
            {
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 },
                { 1, 1, 1, 1, 1, 1, 1, 1 }
            });

            pathFinder.AddTeleport(new Point(1, 1), new Point(6, 6));
            var result = pathFinder.FindPath(new Point(0, 0), new Point(7, 7));

            Assert.IsNotNull(result);
            Assert.IsNotEmpty(result);
            Assert.AreEqual(4, result.Count);
        }