Shift
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Pages
Shift.Point Struct Reference

Describes a 2D-point. More...

Inheritance diagram for Shift.Point:

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

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

Static Public Attributes

static readonly int SizeInBytes = System.Runtime.InteropServices.Marshal.SizeOf(new Point())
 Defines the size of the Point struct in bytes. More...
 

Properties

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

Detailed Description

Describes a 2D-point.

Definition at line 12 of file Point.cs.

Constructor & Destructor Documentation

Shift.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.

Definition at line 57 of file Point.cs.

Shift.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.

Definition at line 67 of file Point.cs.

Member Function Documentation

override bool Shift.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.

Definition at line 144 of file Point.cs.

bool Shift.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.

Definition at line 154 of file Point.cs.

override int Shift.Point.GetHashCode ( )
inline

Gets the hash code of this Point.

Returns
Hash code of this Point.

Definition at line 163 of file Point.cs.

static Shift.Point.operator System.Drawing.Point ( Point  p)
inlineexplicitstatic

Definition at line 187 of file Point.cs.

static Shift.Point.operator System.Drawing.Size ( Point  p)
inlineexplicitstatic

Definition at line 192 of file Point.cs.

static bool Shift.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.

Definition at line 134 of file Point.cs.

static Point Shift.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.

Definition at line 101 of file Point.cs.

static Point Shift.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.

Definition at line 79 of file Point.cs.

static Point Shift.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.

Definition at line 90 of file Point.cs.

static Point Shift.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.

Definition at line 112 of file Point.cs.

static bool Shift.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.

Definition at line 123 of file Point.cs.

override string Shift.Point.ToString ( )
inline

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

Returns
String representation of this Point.

Definition at line 173 of file Point.cs.

Vector2 Shift.Point.ToVector2 ( )
inline

Gets a Vector2 representation for this object.

Returns
A Vector2 representation for this object.

Definition at line 182 of file Point.cs.

Member Data Documentation

readonly int Shift.Point.SizeInBytes = System.Runtime.InteropServices.Marshal.SizeOf(new Point())
static

Defines the size of the Point struct in bytes.

Definition at line 17 of file Point.cs.

int Shift.Point.X

The x coordinate of this Point.

Definition at line 33 of file Point.cs.

int Shift.Point.Y

The y coordinate of this Point.

Definition at line 39 of file Point.cs.

Property Documentation

Point Shift.Point.Zero
staticget

Returns a Point with coordinates 0, 0.

Definition at line 25 of file Point.cs.


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