CellMatchContext
Namespace: Hex1b.Automation
Assembly: Hex1b.dll
Context provided to cell predicates during pattern matching. Contains information about the current position, cell, and match state.
public sealed class CellMatchContextInheritance
Object → CellMatchContext
Properties
Cell
The cell at the current position.
Returns: TerminalCell
public TerminalCell Cell { get; }MatchStartCell
The first cell of this match (where Find() matched).
Returns: TerminalCell
public TerminalCell MatchStartCell { get; }MatchStartPosition
The position where this match started.
Returns: ValueTuple<Int32, Int32>
public (int X, int Y) MatchStartPosition { get; }PreviousCell
The cell from the previous step, or MatchStartCell if this is the first step after Find.
Returns: TerminalCell
public TerminalCell PreviousCell { get; }PreviousPosition
The position of the previous step.
Returns: ValueTuple<Int32, Int32>
public (int X, int Y) PreviousPosition { get; }Region
The region being searched.
Returns: IHex1bTerminalRegion
public IHex1bTerminalRegion Region { get; }TraversedCells
All cells traversed so far in this match attempt.
Returns: IReadOnlyList<TraversedCell>
public IReadOnlyList<TraversedCell> TraversedCells { get; }X
Current X position in the region.
Returns: Int32
public int X { get; }Y
Current Y position in the region.
Returns: Int32
public int Y { get; }Methods
GetAbsolute(int, int)
Gets the cell at an absolute position. Returns TerminalCell.Empty if out of bounds.
Parameters:
Returns: TerminalCell
public TerminalCell GetAbsolute(int x, int y)GetRelative(int, int)
Gets the cell at a relative offset from current position. Returns TerminalCell.Empty if out of bounds.
Parameters:
Returns: TerminalCell
public TerminalCell GetRelative(int deltaX, int deltaY)