示例#1
0
        public Chunk(int x, int y, int width, int height, Map map)
        {
            X      = x;
            Y      = y;
            Width  = width;
            Height = height;

            Map = map;

            myTiles = new GameTile[width, height];

            for (int tx = 0; tx < Width; ++tx)
            {
                for (int ty = 0; ty < Height; ++ty)
                {
                    if (map.IsInterior)
                    {
                        myTiles[tx, ty] = new InteriorTile(X + tx, Y + ty, this, map);
                    }
                    else
                    {
                        myTiles[tx, ty] = new ExteriorTile(X + tx, Y + ty, this, map);
                    }
                }
            }

            myLighting = new LightColour[width + 1, height + 1];

            FillLighting(LightColour.Default);

            myEnts = new List <Entity>();

            myVB = new Rendering.VertexBuffer(map.IsExterior);

            LightSources = new List <Light>();

            myLightingChanged   = true;
            myTilesChanged      = true;
            myEntSortingChanged = true;

            myNeighbours = new Chunk[0];
        }
 public InteriorMaterialInfo(InteriorTile tile)
     : base(tile)
 {
 }