public List <int> Diff(ConsoleRenderBuffer other) { if (other.Width != Width || other.Height != Height) { throw new NotSupportedException("Diff for different sized buffers is not supported"); } List <int> result = new List <int>(); for (int idx = 0; idx <= GetIndex(Width - 1, Height - 1); idx++) { bool valueDiffers = Buffer[idx] != other.Buffer[idx]; bool colorDiffers = ColorBuffer[idx] != other.ColorBuffer[idx]; if (valueDiffers || colorDiffers) { result.Add(idx); } } return(result); }
public void CopyFrom(ConsoleRenderBuffer other) { other.Buffer.CopyTo(Buffer, 0); other.ColorBuffer.CopyTo(ColorBuffer, 0); }