Table of Contents

Method IsEquivalentUnderTranslation

Namespace
Gamelogic.Grids2
Assembly
Gamelogic.Grids2.dll

IsEquivalentUnderTranslation<TPoint>(IEnumerable<TPoint>, IEnumerable<TPoint>, Func<IEnumerable<TPoint>, IEnumerable<TPoint>>)

Applies a function to the shapes and then checks if the results are equivalent.

public static bool IsEquivalentUnderTranslation<TPoint>(IEnumerable<TPoint> shape1, IEnumerable<TPoint> shape2, Func<IEnumerable<TPoint>, IEnumerable<TPoint>> toCanonicalPosition)

Parameters

shape1 IEnumerable<TPoint>

List of points of the shape1.

shape2 IEnumerable<TPoint>

List of points of the shape2.

toCanonicalPosition Func<IEnumerable<TPoint>, IEnumerable<TPoint>>

This function is used to translate the points of the shapes.

Returns

bool

Type Parameters

TPoint

The type of point of the shapes.