Пример #1
0
        void OnResized(int w, int h)
        {
            _size.x = w;
            _size.y = h;

            ClearPath();

            if (_map.IsCreated)
            {
                _map.Dispose();
            }

            _map = new TestMapInt(w, h, Allocator.Persistent);
            _terminal.Resize(w, h);
            _dirty = true;
        }
Пример #2
0
        public static (TestMapInt, int, int) GetMapWithObstacles(int w, int h, Allocator allocator)
        {
            var map = new TestMapInt(w, h, allocator);

            int x = w / 2;

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


            int start = map.PosToIndex(0, 0);
            int end   = map.PosToIndex(w - 1, 0);

            return(map, start, end);
        }