Exemple #1
0
        public static (TestMapInt2, int2, int2) GetInt2MapFromString(
            int w, int h, string str, Allocator allocator)
        {
            var  map   = new TestMapInt2(w, h, str, allocator);
            int2 start = ConvertToMapPos(str.IndexOf('S'), w, h);
            int2 end   = ConvertToMapPos(str.IndexOf('E'), w, h);

            return(map, start, end);
        }
Exemple #2
0
        /// <summary>
        /// Creates a map with a single wall in the middle
        /// </summary>
        public static (TestMapInt2, int2, int2) GetInt2MapWithObstacles(int w, int h, Allocator allocator)
        {
            var map = new TestMapInt2(new int2(w, h), allocator);

            int x = w / 2;

            for (int y = 0; y < h - 2; ++y)
            {
                map.SetTile(x, y, 1);
            }

            int2 start = new int2(0, 0);
            int2 end   = new int2(w - 1, 0);

            return(map, start, end);
        }