Skip to content

When( .. pattern .. ).AllowInverse( descriptor )

Johan Karlsson edited this page Jul 23, 2017 · 1 revision

What

If a detection of a pattern fails and AllowInverse is specified for the pattern then the Evaluator will flip the input list of lines either vertical, horizontal or both depending on the InverseDescriptor passed.

Why

Many times it doesn't matter which order shapes are drawn in. This helps a little bit with making it possible to invert pieces of a pattern.

Example

.When( p=> p.MovesDown().MovesUp() ).AllowInverse(InverseDescriptor.Vertical)

What it doesn't solve

It's a one step action. If you specify BOTH then it will flip X and Y axis at the same time. There might be a way to chain it with two When statements but it's not tested at the moment.

Clone this wiki locally