Nebula
Loading...
Searching...
No Matches
Mathf.Point Struct Reference

Detailed Description

Describes a 2D-point.

Inherits IEquatable< Point >.

Public Member Functions

 Point (int x, int y)
 Constructs a point with X and Y from two values.
 
 Point (int value)
 Constructs a point with X and Y set to the same value.
 
override bool Equals (object obj)
 Compares whether current instance is equal to specified Object.
 
bool Equals (Point other)
 Compares whether current instance is equal to specified Point.
 
override int GetHashCode ()
 Gets the hash code of this Point.
 
override string ToString ()
 Returns a String representation of this Point in the format: {X:[X] Y:[Y]}.
 
Vector2 ToVector2 ()
 Gets a Vector2 representation for this object.
 
void Deconstruct (out int x, out int y)
 Deconstruction method for Point.
 

Static Public Member Functions

static Point operator+ (Point value1, Point value2)
 Adds two points.
 
static Point operator- (Point value1, Point value2)
 Subtracts a Point from a Point.
 
static Point operator* (Point value1, Point value2)
 Multiplies the components of two points by each other.
 
static Point operator/ (Point source, Point divisor)
 Divides the components of a Point by the components of another Point.
 
static bool operator== (Point a, Point b)
 Compares whether two Point instances are equal.
 
static bool operator!= (Point a, Point b)
 Compares whether two Point instances are not equal.
 

Public Attributes

int X
 The x coordinate of this Point.
 
int Y
 The y coordinate of this Point.
 

Properties

static Point Zero [get]
 Returns a Point with coordinates 0, 0.
 
string DebugDisplayString [get]
 

Static Private Attributes

static readonly Point zeroPoint = new Point()
 

Constructor & Destructor Documentation

◆ Point() [1/2]

Mathf.Point.Point ( int x,
int y )
inline

Constructs a point with X and Y from two values.

Parameters
xThe x coordinate in 2d-space.
yThe y coordinate in 2d-space.

◆ Point() [2/2]

Mathf.Point.Point ( int value)
inline

Constructs a point with X and Y set to the same value.

Parameters
valueThe x and y coordinates in 2d-space.

Member Function Documentation

◆ Deconstruct()

void Mathf.Point.Deconstruct ( out int x,
out int y )
inline

Deconstruction method for Point.

Parameters
x
y

◆ Equals() [1/2]

override bool Mathf.Point.Equals ( object obj)
inline

Compares whether current instance is equal to specified Object.

Parameters
objThe Object to compare.
Returns
true if the instances are equal; false otherwise.

◆ Equals() [2/2]

bool Mathf.Point.Equals ( Point other)
inline

Compares whether current instance is equal to specified Point.

Parameters
otherThe Point to compare.
Returns
true if the instances are equal; false otherwise.

◆ GetHashCode()

override int Mathf.Point.GetHashCode ( )
inline

Gets the hash code of this Point.

Returns
Hash code of this Point.

◆ operator!=()

static bool Mathf.Point.operator!= ( Point a,
Point b )
inlinestatic

Compares whether two Point instances are not equal.

Parameters
aPoint instance on the left of the not equal sign.
bPoint instance on the right of the not equal sign.
Returns
true if the instances are not equal; false otherwise.


◆ operator*()

static Point Mathf.Point.operator* ( Point value1,
Point value2 )
inlinestatic

Multiplies the components of two points by each other.

Parameters
value1Source Point on the left of the mul sign.
value2Source Point on the right of the mul sign.
Returns
Result of the multiplication.

◆ operator+()

static Point Mathf.Point.operator+ ( Point value1,
Point value2 )
inlinestatic

Adds two points.

Parameters
value1Source Point on the left of the add sign.
value2Source Point on the right of the add sign.
Returns
Sum of the points.

◆ operator-()

static Point Mathf.Point.operator- ( Point value1,
Point value2 )
inlinestatic

Subtracts a Point from a Point.

Parameters
value1Source Point on the left of the sub sign.
value2Source Point on the right of the sub sign.
Returns
Result of the subtraction.

◆ operator/()

static Point Mathf.Point.operator/ ( Point source,
Point divisor )
inlinestatic

Divides the components of a Point by the components of another Point.

Parameters
sourceSource Point on the left of the div sign.
divisorDivisor Point on the right of the div sign.
Returns
The result of dividing the points.

◆ operator==()

static bool Mathf.Point.operator== ( Point a,
Point b )
inlinestatic

Compares whether two Point instances are equal.

Parameters
aPoint instance on the left of the equal sign.
bPoint instance on the right of the equal sign.
Returns
true if the instances are equal; false otherwise.

◆ ToString()

override string Mathf.Point.ToString ( )
inline

Returns a String representation of this Point in the format: {X:[X] Y:[Y]}.

Returns
String representation of this Point.

◆ ToVector2()

Vector2 Mathf.Point.ToVector2 ( )
inline

Gets a Vector2 representation for this object.

Returns
A Vector2 representation for this object.

Member Data Documentation

◆ X

int Mathf.Point.X

The x coordinate of this Point.

◆ Y

int Mathf.Point.Y

The y coordinate of this Point.

◆ zeroPoint

readonly Point Mathf.Point.zeroPoint = new Point()
staticprivate

Property Documentation

◆ DebugDisplayString

string Mathf.Point.DebugDisplayString
getpackage

◆ Zero

Point Mathf.Point.Zero
staticget

Returns a Point with coordinates 0, 0.


The documentation for this struct was generated from the following file: