Table of Contents

Method SwapXY

Namespace
Gamelogic.Grids2
Assembly
Gamelogic.Grids2.dll

SwapXY(IExplicitShape<GridPoint2>)

Constructs a new 2D shape from a given shape with the X and Y coordinates swapped.

[Version(2, 2, 0)]
public static IExplicitShape<GridPoint2> SwapXY(this IExplicitShape<GridPoint2> shape)

Parameters

shape IExplicitShape<GridPoint2>

Returns

IExplicitShape<GridPoint2>

Examples

The rect with three points (0, 1), (1, 1), and (2, 1) will become the rect with the three points (1, 0), (1, 1) and (1, 2). This is the same as reflecting the shape through the line x = y.