Skip to content

AppliedToken ​

Namespace: Hex1b.Tokens

Assembly: Hex1b.dll

Represents a token that has been applied to the terminal buffer, bundled with metadata about what changed.

csharp
public record AppliedToken : IEquatable<AppliedToken>

Inheritance ​

Object → AppliedToken

Implements ​

Constructors ​

AppliedToken(AnsiToken, IReadOnlyList<CellImpact>, int, int, int, int) ​

Represents a token that has been applied to the terminal buffer, bundled with metadata about what changed.

Parameters:

  • Token (AnsiToken): The original ANSI token that was applied.
  • CellImpacts (IReadOnlyList<CellImpact>): The cells that were modified by this token.
  • CursorXBefore (Int32): The cursor column position before the token was applied.
  • CursorYBefore (Int32): The cursor row position before the token was applied.
  • CursorXAfter (Int32): The cursor column position after the token was applied.
  • CursorYAfter (Int32): The cursor row position after the token was applied.
csharp
public AppliedToken(AnsiToken Token, IReadOnlyList<CellImpact> CellImpacts, int CursorXBefore, int CursorYBefore, int CursorXAfter, int CursorYAfter)

Properties ​

CellImpacts ​

The cells that were modified by this token.

Returns: IReadOnlyList<CellImpact>

csharp
public IReadOnlyList<CellImpact> CellImpacts { get; init; }

CursorMoved ​

Gets whether the cursor position changed.

Returns: Boolean

csharp
public bool CursorMoved { get; }

CursorXAfter ​

The cursor column position after the token was applied.

Returns: Int32

csharp
public int CursorXAfter { get; init; }

CursorXBefore ​

The cursor column position before the token was applied.

Returns: Int32

csharp
public int CursorXBefore { get; init; }

CursorYAfter ​

The cursor row position after the token was applied.

Returns: Int32

csharp
public int CursorYAfter { get; init; }

CursorYBefore ​

The cursor row position before the token was applied.

Returns: Int32

csharp
public int CursorYBefore { get; init; }

GraphicsImpacts ​

Gets graphics placement or damage regions produced by this token.

Returns: IReadOnlyList<TerminalGraphicsImpact>

csharp
public IReadOnlyList<TerminalGraphicsImpact> GraphicsImpacts { get; init; }

HasCellImpacts ​

Gets whether this token modified any cells.

Returns: Boolean

csharp
public bool HasCellImpacts { get; }

HasGraphicsImpacts ​

Gets whether this token changed terminal graphics state.

Returns: Boolean

csharp
public bool HasGraphicsImpacts { get; }

Token ​

The original ANSI token that was applied.

Returns: AnsiToken

csharp
public AnsiToken Token { get; init; }

Methods ​

WithNoCellImpacts(AnsiToken, int, int, int, int) ​

Creates an AppliedToken with no cell impacts (for tokens that only affect cursor or state).

Parameters:

Returns: AppliedToken

csharp
public static AppliedToken WithNoCellImpacts(AnsiToken token, int cursorXBefore, int cursorYBefore, int cursorXAfter, int cursorYAfter)

Released under the MIT License.