Skip to content
ConsoleMonster

API Reference

Struct

Cell

Namespace ConsoleMonster.Canvas
Assembly ConsoleMonster
Source Cell.cs:15
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 System.String requiredposition: 0
The grapheme (a single space for blank).
style ConsoleMonster.Styling.Style requiredposition: 1
The style.
width System.Byte = 1 optionalposition: 2
1 for normal, 2 for the first half of a wide grapheme, 0 for a continuation.

Methods

Equals 2 overloads
public Boolean Equals(Cell other) #
Returns: Boolean

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

Parameters

other ConsoleMonster.Canvas.Cell requiredposition: 0
An object to compare with this object.

Returns

true if the current object is equal to the other parameter; otherwise, false.

public override Boolean Equals(Object? obj) #
Returns: Boolean

Indicates whether this instance and a specified object are equal.

Parameters

obj System.Object? requiredposition: 0
The object to compare with the current instance.

Returns

true if obj and this instance are the same type and represent the same value; otherwise, false.

public override Int32 GetHashCode() #
Returns: Int32

Returns the hash code for this instance.

Returns

A 32-bit signed integer that is the hash code for this instance.

public static Boolean op_Equality(Cell left, Cell right) #
Returns: Boolean

Equality operator.

Parameters

left ConsoleMonster.Canvas.Cell requiredposition: 0
Left.
right ConsoleMonster.Canvas.Cell requiredposition: 1
Right.

Returns

Whether equal.

public static Boolean op_Inequality(Cell left, Cell right) #
Returns: Boolean

Inequality operator.

Parameters

left ConsoleMonster.Canvas.Cell requiredposition: 0
Left.
right ConsoleMonster.Canvas.Cell requiredposition: 1
Right.

Returns

Whether different.

public override String ToString() #
Returns: String

Returns the fully qualified type name of this instance.

Returns

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 Boolean IsContinuation { get; } #

Whether this is the second half of a wide grapheme.