Nostalgia  2.1.5
Point2 Struct Reference

Classes for handling two-dimensional integer coordinates. More...

Inheritance diagram for Point2:

Public Member Functions

 Point2 (int x, int y)
 Initializes a new instance of the Nostalgia.Point2 class. More...
 
 Point2 (Point2 p)
 Initializes a new instance of the Nostalgia.Point2 class. More...
 
bool IsInsideRect (int x, int y, int width, int height)
 It is inside a rectangle More...
 

Static Public Member Functions

static Point2 operator+ (Point2 a, Point2 b)
 Addition of Point2 each other. More...
 
static Point2 operator- (Point2 a, Point2 b)
 Subtraction of Point2 each other. More...
 
static Point2 operator- (Point2 a)
 Inversion of the sign. More...
 
static Point2 operator* (Point2 a, int b)
 Multiplication of Point2. More...
 
static Point2 operator* (int a, Point2 b)
 Multiplication of Point2. More...
 
static Point2 operator/ (Point2 a, int b)
 Division of Point2. More...
 
static bool operator== (Point2 a, Point2 b)
 Returns true if the Point2s are equal. More...
 
static bool operator!= (Point2 a, Point2 b)
 Returns true if Point2s different. More...
 
static implicit operator Point2 (Vector2 v)
 Performs an implicit conversion from Vector2 to Point2. More...
 
static implicit operator Vector2 (Point2 p)
 Performs an implicit conversion from Point2 to Vector2. More...
 

Public Attributes

int x
 The x coordinate. More...
 
int y
 The y coordinate. More...
 

Static Public Attributes

static readonly Point2 zero = new Point2(0, 0)
 Get Point2 of (0,0). More...
 

Properties

float sqrMagnitude [get]
 Returns the squared length of this Point2. More...
 
float magnitude [get]
 Returns the length of this Point2. More...
 

Detailed Description

Classes for handling two-dimensional integer coordinates.

Constructor & Destructor Documentation

Point2 ( int  x,
int  y 
)

Initializes a new instance of the Nostalgia.Point2 class.

Parameters
xThe x coordinate.
yThe y coordinate.
Point2 ( Point2  p)

Initializes a new instance of the Nostalgia.Point2 class.

Parameters
pPoint2

Member Function Documentation

bool IsInsideRect ( int  x,
int  y,
int  width,
int  height 
)

It is inside a rectangle

Parameters
xx
yy
widthwidth
heightheight
Returns
True if it is inside the rectangle
static implicit operator Point2 ( Vector2  v)
static

Performs an implicit conversion from Vector2 to Point2.

Parameters
vVector2.
Returns
The result of the conversion.
static implicit operator Vector2 ( Point2  p)
static

Performs an implicit conversion from Point2 to Vector2.

Parameters
pPoint2
Returns
The result of the conversion.
static bool operator!= ( Point2  a,
Point2  b 
)
static

Returns true if Point2s different.

static Point2 operator* ( Point2  a,
int  b 
)
static

Multiplication of Point2.

static Point2 operator* ( int  a,
Point2  b 
)
static

Multiplication of Point2.

static Point2 operator+ ( Point2  a,
Point2  b 
)
static

Addition of Point2 each other.

static Point2 operator- ( Point2  a,
Point2  b 
)
static

Subtraction of Point2 each other.

static Point2 operator- ( Point2  a)
static

Inversion of the sign.

static Point2 operator/ ( Point2  a,
int  b 
)
static

Division of Point2.

static bool operator== ( Point2  a,
Point2  b 
)
static

Returns true if the Point2s are equal.

Member Data Documentation

int x

The x coordinate.

int y

The y coordinate.

readonly Point2 zero = new Point2(0, 0)
static

Get Point2 of (0,0).

Property Documentation

float magnitude
get

Returns the length of this Point2.

The magnitude.

float sqrMagnitude
get

Returns the squared length of this Point2.

the squared length.