AStarTest.Map.Map C# (CSharp) Method

Map() public method

public Map ( int width, int height, int depth ) : System
width int
height int
depth int
return System
        public Map(int width, int height, int depth)
        {
            this.Grid = new AStarMapTile[depth, height, width];

            this.Bounds = new IntGrid3(0, 0, 0, width, height, depth);

            for (int y = 0; y < 350; ++y)
                SetBlocked(new IntVector3(5, y, 0), true);

            for (int y = 2; y < 22; ++y)
                SetBlocked(new IntVector3(14, y, 0), true);

            for (int y = 6; y < 11; ++y)
                SetWeight(new IntVector3(10, y, 0), 40);

            for (int y = 6; y < 18; ++y)
                SetBlocked(new IntVector3(3, y, 1), true);

            for (int y = 6; y < 11; ++y)
                SetWeight(new IntVector3(5, y, 1), 40);

            SetStairs(new IntVector3(10, 10, 0), Stairs.Up);
            SetStairs(new IntVector3(10, 10, 1), Stairs.Down);

            SetStairs(new IntVector3(15, 12, 0), Stairs.Up);
            SetStairs(new IntVector3(15, 12, 1), Stairs.Down);

            var r = new Random(4);
            var bounds = new IntGrid2Z(16, 0, 30, 30, 0);
            foreach (var p in bounds.Range())
            {
                var v = r.Next(100);
                if (v < 30)
                    SetBlocked(p, true);
                else if (v < 60)
                    SetWeight(p, v);
            }
        }