Skip to content

CellPatternMatch

Namespace: Hex1b.Automation

Assembly: Hex1b.dll

Represents a successful pattern match containing all traversed cells and capture information.

csharp
public sealed class CellPatternMatch

Inheritance

ObjectCellPatternMatch

Properties

Bounds

Bounding rectangle containing all matched cells.

Returns: Rect

csharp
public Rect Bounds { get; }

CaptureNames

Names of all captures in this match.

Returns: IReadOnlySet<String>

csharp
public IReadOnlySet<string> CaptureNames { get; }

Cells

All cells traversed in order.

Returns: IReadOnlyList<TraversedCell>

csharp
public IReadOnlyList<TraversedCell> Cells { get; }

End

Ending position of the match (last traversed cell).

Returns: ValueTuple<Int32, Int32>

csharp
public (int X, int Y) End { get; }

Start

Starting position of the match (first traversed cell).

Returns: ValueTuple<Int32, Int32>

csharp
public (int X, int Y) Start { get; }

Text

Gets the text content of all matched cells.

Returns: String

csharp
public string Text { get; }

Methods

GetCapture(string)

Gets cells belonging to a named capture. Returns empty list if capture doesn't exist.

Parameters:

Returns: IReadOnlyList<TraversedCell>

csharp
public IReadOnlyList<TraversedCell> GetCapture(string name)

GetCaptureBounds(string)

Gets the bounding rectangle of a named capture. Returns empty rect if capture doesn't exist.

Parameters:

Returns: Rect

csharp
public Rect GetCaptureBounds(string name)

GetCaptureText(string)

Gets the text content of a named capture. Returns empty string if capture doesn't exist.

Parameters:

Returns: String

csharp
public string GetCaptureText(string name)

HasCapture(string)

Checks if a capture with the given name exists.

Parameters:

Returns: Boolean

csharp
public bool HasCapture(string name)

Released under the MIT License.