Skip to content
ConsoleMonster
Struct

Cell

ConsoleMonster.Canvas

Namespace
ConsoleMonster.Canvas
Assembly
ConsoleMonster
Base
ValueType
Implements
IEquatable<Cell>
Modifiers
sealed

One terminal cell: a grapheme, its style and its width. A wide grapheme occupies two cells; the second is a continuation cell with Cell.Width 0 and an empty glyph.

Inheritance

  • ValueType
  • Cell

Usage

Explore 8 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 3

Accepted by parameters 5

Constructors

public Cell(string glyph, Style style, byte width = 1) #

Creates a cell.

Parameters

glyph string required
The grapheme (a single space for blank).
style ConsoleMonster.Styling.Style required
The style.
width byte = 1 optional
1 for normal, 2 for the first half of a wide grapheme, 0 for a continuation.

Methods

Equals 2 overloads
public bool Equals(Cell other) #

Indicates whether the current object is equal to another object of the same type.

Parameters

other ConsoleMonster.Canvas.Cell required
An object to compare with this object.

Returns

bool true if the current object is equal to the other parameter; otherwise, false.
public override bool Equals(object? obj) #

Indicates whether this instance and a specified object are equal.

Parameters

obj object? required
The object to compare with the current instance.

Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.
public override int GetHashCode() #

Returns the hash code for this instance.

Returns

int A 32-bit signed integer that is the hash code for this instance.
public static bool op_Equality(Cell left, Cell right) #

Equality operator.

Parameters

left ConsoleMonster.Canvas.Cell required
Left.
right ConsoleMonster.Canvas.Cell required
Right.

Returns

bool Whether equal.
public static bool op_Inequality(Cell left, Cell right) #

Inequality operator.

Parameters

left ConsoleMonster.Canvas.Cell required
Left.
right ConsoleMonster.Canvas.Cell required
Right.

Returns

bool Whether different.
public override string ToString() #

Returns the fully qualified type name of this instance.

Returns

string The fully qualified type name.

Properties

public static Cell Blank { get; } #

A blank cell with the plain style.

public string Glyph { get; } #

The grapheme; never null for cells read from a buffer.

public Style Style { get; } #

The style.

public byte Width { get; } #

1 for normal, 2 for the first half of a wide grapheme, 0 for a continuation cell.

public bool IsContinuation { get; } #

Whether this is the second half of a wide grapheme.