C# Class GameMath.Directions

Show file Open project: npruehs/game-math

Public Methods

Method Description
All ( ) : IEnumerable

All eight cardinal directions, starting north, in clockwise order.

Diagonal ( ) : IEnumerable

All diagonal directions, starting north-west, in clockwise order.

HorizontalVertical ( ) : IEnumerable

Four horizonal and vertical directions, starting north, in clockwise order.

IsDiagonal ( this direction ) : bool

Checks whether the specified direction is diagonal.

IsHorizontal ( this direction ) : bool

Checks whether the specified direction is horizontal.

IsVertical ( this direction ) : bool

Checks whether the specified direction is vertical.

Opposite ( this direction ) : Direction

Returns the opposite of the passed direction.

Method Details

All() public static method

All eight cardinal directions, starting north, in clockwise order.
public static All ( ) : IEnumerable
return IEnumerable

Diagonal() public static method

All diagonal directions, starting north-west, in clockwise order.
public static Diagonal ( ) : IEnumerable
return IEnumerable

HorizontalVertical() public static method

Four horizonal and vertical directions, starting north, in clockwise order.
public static HorizontalVertical ( ) : IEnumerable
return IEnumerable

IsDiagonal() public static method

Checks whether the specified direction is diagonal.
public static IsDiagonal ( this direction ) : bool
direction this Direction to check.
return bool

IsHorizontal() public static method

Checks whether the specified direction is horizontal.
public static IsHorizontal ( this direction ) : bool
direction this Direction to check.
return bool

IsVertical() public static method

Checks whether the specified direction is vertical.
public static IsVertical ( this direction ) : bool
direction this Direction to check.
return bool

Opposite() public static method

Returns the opposite of the passed direction.
public static Opposite ( this direction ) : Direction
direction this Direction to get the opposite of.
return Direction