Skip to content

PointLocator

Namespace: E2E.Decision

public sealed class PointLocator

Locates drawn controls on the screenshot and remembers the ones a tap found: three looks per control, the column and row on the plain full screenshot, then again on two ever tighter zoomed crops with a grid drawn on them; a field takes the first look alone. A tap that changed the pixels around it found its control; the same control on the same page is tapped there again with no new looks (upstream’s PointLocator).

Inheritance: object

View source

PointLocator(StepExecutorContext, AskDecision, Gates)

Section titled “PointLocator(StepExecutorContext, AskDecision, Gates)”
public PointLocator(StepExecutorContext ctx, AskDecision ask, Gates gates)

Locates drawn controls on the screenshot and remembers the ones a tap found: three looks per control, the column and row on the plain full screenshot, then again on two ever tighter zoomed crops with a grid drawn on them; a field takes the first look alone. A tap that changed the pixels around it found its control; the same control on the same page is tapped there again with no new looks (upstream’s PointLocator).

Parameters

Name Type Description
ctx StepExecutorContext
ask AskDecision
gates Gates

public Point? Known(string path, string wanted, Aim aim)

A point already known for this control on this page.

Parameters

Name Type Description
path string
wanted string
aim Aim

Returns: Point?

LocateAsync(Screenshot, string, string, Aim)

Section titled “LocateAsync(Screenshot, string, string, Aim)”
public Task<Located?> LocateAsync(Screenshot screenshot, string path, string wanted, Aim aim)

The looks for the control or field, or null once the budget is spent.

Parameters

Name Type Description
screenshot Screenshot
path string
wanted string
aim Aim

Returns: Task<Located>

public void Settle(Screenshot? screenshot)

Settles the last point tap against the newest pixels: changed means it landed.

Parameters

Name Type Description
screenshot Screenshot

Tapped(string, string, Aim, Point, Screenshot)

Section titled “Tapped(string, string, Aim, Point, Screenshot)”
public void Tapped(string path, string wanted, Aim aim, Point point, Screenshot screenshot)

Records a point tap, to be settled by the next observation.

Parameters

Name Type Description
path string
wanted string
aim Aim
point Point
screenshot Screenshot