AppliedToken
Namespace: Hex1b.Tokens
Assembly: Hex1b.dll
Represents a token that has been applied to the terminal buffer, bundled with metadata about what changed.
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.
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>
public IReadOnlyList<CellImpact> CellImpacts { get; init; }CursorMoved
Gets whether the cursor position changed.
Returns: Boolean
public bool CursorMoved { get; }CursorXAfter
The cursor column position after the token was applied.
Returns: Int32
public int CursorXAfter { get; init; }CursorXBefore
The cursor column position before the token was applied.
Returns: Int32
public int CursorXBefore { get; init; }CursorYAfter
The cursor row position after the token was applied.
Returns: Int32
public int CursorYAfter { get; init; }CursorYBefore
The cursor row position before the token was applied.
Returns: Int32
public int CursorYBefore { get; init; }GraphicsImpacts
Gets graphics placement or damage regions produced by this token.
Returns: IReadOnlyList<TerminalGraphicsImpact>
public IReadOnlyList<TerminalGraphicsImpact> GraphicsImpacts { get; init; }HasCellImpacts
Gets whether this token modified any cells.
Returns: Boolean
public bool HasCellImpacts { get; }HasGraphicsImpacts
Gets whether this token changed terminal graphics state.
Returns: Boolean
public bool HasGraphicsImpacts { get; }Token
The original ANSI token that was applied.
Returns: AnsiToken
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:
token(AnsiToken):cursorXBefore(Int32):cursorYBefore(Int32):cursorXAfter(Int32):cursorYAfter(Int32):
Returns: AppliedToken
public static AppliedToken WithNoCellImpacts(AnsiToken token, int cursorXBefore, int cursorYBefore, int cursorXAfter, int cursorYAfter)