Click or drag to resize

GridPoint2 Structure

A discrete 2D vector, used to index into 2D grids.

Namespace:  Gamelogic.Grids2
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
[SerializableAttribute]
public struct GridPoint2 : IEquatable<GridPoint2>

The GridPoint2 type exposes the following members.

Constructors
  NameDescription
Public methodGridPoint2
Creates a new instance of the GridPoint2 struct.
Top
Properties
  NameDescription
Public propertyX
The X coordinate of this point.
Public propertyY
The Y coordinate of this point.
Top
Methods
  NameDescription
Public methodAdd
Adds an other grid point to this grid point and returns the result.
Public methodDiv(Int32) Obsolete.
Public methodDiv(GridPoint2) Obsolete.
Gives a new point that represents the first point divided by the second point component-wise.The division is integer division.
Public methodDot
Calculates the dot product between this grid point and another.
Public methodEquals(Object) (Overrides ValueTypeEquals(Object).)
Public methodEquals(GridPoint2)
Compares this grid point with another grid point for equality. Two grid points are equal if their respective coordinates are equal.
Public methodFloorDiv(Int32)
Divides each coordinate with r, using integer floor division.
Public methodFloorDiv(GridPoint2)
Gives a new point that represents the first point divided by the second point component-wise.The division is integer division.
Public methodFloorMod
Gives a new point that represents the reminder when the first point is divided by the second point component-wise. The division is integer floor division.
Public methodGetColor(ColorFunction)
Gets the color index for this point for the given color function.
Public methodGetColor(Int32, Int32, Int32)
Gets the color index for this point for the given coloring parameters.
Public methodGetForwardVectorRays
Gets the maps that represent the forward vector rays through this point in the given list of directions.
Public methodGetHashCode (Overrides ValueTypeGetHashCode.)
Public methodGetReverseVectorRays
Gets the maps that represent the reverse vector lines through this point in the given list of directions.
Public methodGetType (Inherited from Object.)
Public methodStatic memberGetVectorLine
Gets the map that represents a line through this point in the given direction.
Public methodStatic memberGetVectorLines
Gets the maps that represent the vector lines through this point in the given list of directions.
Public methodGetVectorNeighbors
Gets the vector neighbors of this point in the given direction.
Public methodStatic memberHadamardMul Obsolete.
Public methodHexDot
Calculates the hex-grid equivalent for the dot product.
Public methodStatic memberMax
Calculates a new grid point with coordinates the maximum of the respective coordinates of two grid points.
Public methodStatic memberMin
Calculates a new grid point with coordinates the minimum of the respective coordinates of two grid points.
Public methodMod Obsolete.
Gives a new point that represents the reminder when the first point is divided by the second point component-wise.The division is integer division.
Public methodMul(Int32)
Multiplies each coordinate with the specified integer.
Public methodMul(GridPoint2)
Gives a new point that represents the first point multiplied by the second point component-wise.
Public methodCode exampleNegate
Returns the point with each coordinate negated.
Public methodPerp
Calculates the vector perpendicular to this vector (rotated counter-clockwise).
Public methodPerpDot
Calculates the perp dot product between this grid point and another.
Public methodSubtract
Subtracts the other point from this point, and returns the result.
Public methodTo3DXY
Converts this point to GridPoint 3.
Public methodTo3DXZ
Converts the point to GridPoint2.
Public methodToString (Overrides ValueTypeToString.)
Public methodToVector2
Converts this grid point to a Vector2.
Public methodTruncDiv(Int32)
Divides each coordinate with r, using integer trunc division.
Public methodTruncDiv(GridPoint2)
Gives a new point that represents the first point divided by the second point component-wise.The division is integer division.
Public methodTruncMod
Gives a new point that represents the reminder when the first point is divided by the second point component-wise. The division is integer trunc division.
Top
Operators
  NameDescription
Public operatorStatic memberAddition
Adds two points by adding their corresponding coordinates.
Public operatorStatic memberDivision(GridPoint2, GridPoint2)
Divides corresponding coordinates using integer division.
Public operatorStatic memberDivision(GridPoint2, Int32)
Divides each coordinate by the integer using integer division.
Public operatorStatic memberEquality
Compares two points for equality.
Public operatorStatic member(GridPoint2 to Vector2)
Converts this grid point to a Vector2.
Public operatorStatic memberInequality
Checks whether two points are not equal.
Public operatorStatic memberModulus
Divides corresponding coordinates using integer division and return the remainders as a new grid point.
Public operatorStatic memberMultiply(Int32, GridPoint2)
Multiplies each coordinate with the integer.
Public operatorStatic memberMultiply(GridPoint2, GridPoint2)
Multiplies corresponding coordinates.
Public operatorStatic memberMultiply(GridPoint2, Int32)
Multiplies each coordinate with the integer.
Public operatorStatic memberSubtraction
Subtracts one point from another by subtracting corresponding coordinates.
Public operatorStatic memberUnaryNegation
Negates the given vector.
Public operatorStatic memberUnaryPlus
This operations does not affect the point.
Top
Fields
  NameDescription
Public fieldStatic memberOne
The grid point with all coordinates equal to 1.
Public fieldStatic memberZero
The zero grid point, also called the origin. All coordinates are 0.
Top
Extension Methods
  NameDescription
Public Extension MethodMul (Defined by MatrixExtensions.)
Top
Remarks
Grid points work like vectors, except their components are integers. Grid points can be used on their own, but they are frequently used with grids and shapes.
See Also