Class CharacterBufferSnapshot
- Namespace
- SharpConsoleUI.Diagnostics.Snapshots
- Assembly
- SharpConsoleUI.dll
Captures the state of a CharacterBuffer at a specific point in time. Used for validation, debugging, and regression testing.
public class CharacterBufferSnapshot
- Inheritance
-
CharacterBufferSnapshot
- Inherited Members
Properties
Cells
Gets the deep copy of the cell array.
public Cell[,] Cells { get; init; }
Property Value
- Cell[,]
DirtyCells
Gets the list of dirty cells at the time of capture.
public List<CellChange> DirtyCells { get; init; }
Property Value
DirtyRegion
Gets the dirty region bounds.
public LayoutRect DirtyRegion { get; init; }
Property Value
FrameNumber
Gets the frame number this snapshot represents.
public int FrameNumber { get; init; }
Property Value
Height
Gets the height of the captured buffer.
public int Height { get; init; }
Property Value
Timestamp
Gets the timestamp when this snapshot was taken.
public DateTime Timestamp { get; init; }
Property Value
Width
Gets the width of the captured buffer.
public int Width { get; init; }
Property Value
Methods
CountCellsMatching(Func<Cell, bool>)
Counts the number of cells matching the given predicate.
public int CountCellsMatching(Func<Cell, bool> predicate)
Parameters
Returns
GetCell(int, int)
Gets the cell at the specified position.
public Cell GetCell(int x, int y)
Parameters
Returns
GetDifferences(CharacterBufferSnapshot)
Compares this snapshot with another and returns the differences.
public List<CellChange> GetDifferences(CharacterBufferSnapshot other)
Parameters
otherCharacterBufferSnapshot
Returns
ToAsciiArt()
Converts the buffer to ASCII art for visualization.
public string ToAsciiArt()
Returns
ToDebugString()
Returns a debug string representation of the buffer.
public string ToDebugString()
Returns
ValidateRegion(LayoutRect, Func<Cell, bool>)
Validates that all cells in the specified region match the given predicate.
public bool ValidateRegion(LayoutRect region, Func<Cell, bool> predicate)
Parameters
regionLayoutRectpredicateFunc<Cell, bool>