Engine.Objects.Layer.AdjustTiles C# (CSharp) Method

AdjustTiles() public method

Adjusts the tile indicies for when tiles were removed or added.
public AdjustTiles ( short startindex, short delta ) : void
startindex short Index to start at.
delta short How much of a shift to make.
return void
        public void AdjustTiles(short startindex, short delta)
        {
            for (int i = 0, size = Width*Height; i < size; ++i)
            {
                short v = _tiles.Array[i];
                if (v > startindex)
                {
                    v += delta;
                    _tiles.Array[i] = Math.Max((short)0, v);
                }
            }
        }