Point

Class in ChivalrousGames.Common / Implements : IComparable

#### Description

Point composed of three integers. Mostly used as a coordinate, but could also represent an int 3d vector, etc.

#### Properties

 X int ReadOnly Gets the x value of the Point Y int ReadOnly Gets the y value of the Point Z int ReadOnly Gets the z value of the Point Zero Point ReadOnly Static Gets a zero valued Point

#### Constructors

##### Constructor
``public Point(int x, int y, int z);``
###### Parameters
 x int The x value of the Point y int The y value of the Point z int The z value of the Point
###### Return

A new instance of Point

###### Description

Creates a new point with the specified x, y and z values.

##### Constructor
``public Point(Point point) : this(point.x, point.y, point.z);``
###### Parameters
 point Point The Point to create a new instance of.
###### Return

A new instance of Point

###### Description

Creates a new instance of the specified Point with the same x, y and z values.

#### Methods

##### ToVector3
``public Vector3 ToVector3();``
###### Return

A new instance of Vector3

###### Description

Converts a Point to a Vector3

##### GetUpPoint
``public Point GetUpPoint();``
###### Return

A new instance of Point

###### Description

Get a new point just above the current one (same x, y+1, same z)

##### GetDownPoint
``public Point GetDownPoint();``
###### Return

A new instance of Point

###### Description

Get a new point just below the current one (same x, y-1, same z)

##### GetLeftPoint
``public Point GetLeftPoint();``
###### Return

A new instance of Point

###### Description

Get a new point just on the left of the current one (x-1, same y, same z)

##### GetRightPoint
``public Point GetRightPoint();``
###### Return

A new instance of Point

###### Description

Get a new point just on the right of the current one (x+1, same y, same z)

##### GetForwardPoint
``public Point GetForwardPoint();``
###### Return

A new instance of Point

###### Description

Get a new point just forward of the current one (same x, same y, same z+1)

##### GetBackwardPoint
``public Point GetBackwardPoint();``
###### Return

A new instance of Point

###### Description

Get a new point just backward of the current one (same x, same y, same z-1)

##### DistanceToPoint
``public int DistanceToPoint(Point otherPoint);``
###### Parameters
 otherPoint Point Other point to which distance is calculated
###### Return
 int The distance from current point to the otherPoint
###### Description

Calculates the distance from the current point to another point. The distance is always >= 0.

##### GetPointValueByDirection
``public int GetPointValueByDirection(Direction direction);``
###### Parameters
 direction Direction The Direction for which the value is requested
###### Return
 int The x, y or z value depending on the specified Direction
###### Description

Gets the point value by Direction. Left and Right will return the x value. Up and Down will return the y value. forward and Backward will return the z value. None will raise an ArgumentException since there can be no value.

##### GetPointValueByAxis
``public int GetPointValueByAxis(Axis axis);``
###### Parameters
 axis Axis The axis
###### Return
 int The x, y or z value depending on the specified Direction
###### Description

Gets the point value by Axis.

##### SetPointValueByAxis
``public void SetPointValueByAxis(Axis axis, int value);``
###### Parameters
 axis Axis The axis value int The new value to set on the point
###### Description

Sets the point value by Axis.

##### GetNeighborPointByDirection
``public Point GetNeighborPointByDirection(Direction direction);``
###### Parameters
 direction Direction The Direction for which the neighbor Point is requested
###### Return
 Point A new instance of Point with the neighbor Point values.
###### Description

This method is used to get the neighbor point in a specified Direction. Pretty much like calling GetUpPoint(), GetDownPoint(), GetRightPoint(), GetLeftPoint(), GetForwardPoint() or GetBackwardPoint().

##### IsNeighbor
``public bool IsNeighbor(Point point);``
###### Parameters
 point Point the point to verify
###### Return
 bool true if a neighbor; otherwise, false.
###### Description

Verifies if a given point is a neighbor of this point.

#### Static Methods

##### GetNeighborPointByDirection
``public static Point GetNeighborPointByDirection(Point point, Direction direction);``
###### Parameters
 point Point The starting Point direction Direction The Direction for which the neighbor Point is requested
###### Return
 Point A new instance of Point with the neighbor Point values.
###### Description

Exactly like calling GetNeighborPointByDirection() except that the point is passed in param.