Dwarrowdelf.Client.GrowingTileGrid.SetSize C# (CSharp) Method

SetSize() public method

public SetSize ( IntSize3 size ) : void
size IntSize3
return void
        public void SetSize(IntSize3 size)
        {
            if (!this.Size.IsEmpty)
                throw new Exception();

            this.Size = size;
            m_grid = new TileData[size.Depth, size.Height, size.Width];

            Debug.Print("GrowingTileGrid.SetSize({0})", this.Size);
        }

Usage Example

        public override void ReceiveObjectData(BaseGameObjectData _data)
        {
            var data = (EnvironmentObjectData)_data;

            base.ReceiveObjectData(_data);

            // XXX we currently always get the map size
            if (!data.Size.IsEmpty)
            {
                m_tileGrid.SetSize(data.Size);
            }

            this.VisibilityMode = data.VisibilityMode;
        }