Struct Cell
- Namespace
- SharpConsoleUI.Layout
- Assembly
- SharpConsoleUI.dll
Represents a single character cell in the character buffer. Contains the character, foreground color, background color, and dirty state.
public struct Cell : IEquatable<Cell>
- Implements
- Inherited Members
Constructors
Cell(char, Color, Color)
Creates a new cell with the specified values.
public Cell(char character, Color foreground, Color background)
Parameters
charactercharforegroundColorbackgroundColor
Fields
Background
The background color.
public Color Background
Field Value
- Color
Character
The character to display.
public char Character
Field Value
Dirty
Whether this cell has been modified since the last render.
public bool Dirty
Field Value
Foreground
The foreground color.
public Color Foreground
Field Value
- Color
Properties
Blank
Gets a blank cell with default colors.
public static Cell Blank { get; }
Property Value
Methods
AsClean()
Returns a copy of this cell with the dirty flag cleared.
public Cell AsClean()
Returns
AsDirty()
Returns a copy of this cell with the dirty flag set.
public Cell AsDirty()
Returns
BlankWithBackground(Color)
Gets a blank cell with the specified background color.
public static Cell BlankWithBackground(Color background)
Parameters
backgroundColor
Returns
Create(char, Color, Color)
Creates a cell with the specified character and colors.
public static Cell Create(char character, Color foreground, Color background)
Parameters
charactercharforegroundColorbackgroundColor
Returns
Equals(Cell)
Determines whether this cell equals another cell.
public bool Equals(Cell other)
Parameters
otherCell
Returns
Equals(object?)
Determines whether this cell equals another object.
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
Gets the hash code for this cell.
public override int GetHashCode()
Returns
ToString()
Returns a string representation of this cell.
public override string ToString()
Returns
VisuallyEquals(Cell)
Determines whether this cell has the same visual appearance as another. Does not compare dirty state.
public bool VisuallyEquals(Cell other)
Parameters
otherCell
Returns
Operators
operator ==(Cell, Cell)
Equality operator.
public static bool operator ==(Cell left, Cell right)
Parameters
Returns
operator !=(Cell, Cell)
Inequality operator.
public static bool operator !=(Cell left, Cell right)