Photon Quantum 3.0.0

Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Photon.Deterministic.IntVector2 Struct Reference

Represents a two-dimensional vector with integer components. More...

Inherits IEquatable< IntVector2 >.

Classes

class  EqualityComparer
 Represents an equality comparer for IntVector2 objects. More...
 

Public Member Functions

 IntVector2 (int x, int y)
 Initializes a new instance of the IntVector2 struct. More...
 
bool Equals (IntVector2 other)
 Determines whether the specified IntVector2 is equal to the current IntVector2. More...
 
override bool Equals (object obj)
 Determines whether the specified object is equal to the current IntVector2. More...
 
override int GetHashCode ()
 Returns a hash code for this instance. More...
 
override string ToString ()
 Returns a string that represents the current IntVector2. More...
 

Static Public Member Functions

static IntVector2 CeilToInt (FPVector2 v)
 Returns a new IntVector2 with the smallest integer greater than or equal to the components of the given FPVector2. More...
 
static IntVector2 Clamp (IntVector2 value, IntVector2 min, IntVector2 max)
 Clamps a IntVector2 value between a minimum and maximum value. More...
 
static FP Distance (IntVector2 a, IntVector2 b)
 Calculates the distance between two IntVector2 points. More...
 
static IntVector2 FloorToInt (FPVector2 v)
 Returns the largest integer less than or equal to the specified floating-point number. More...
 
static IntVector2 Max (IntVector2 a, IntVector2 b)
 Returns a new IntVector2 with the largest components of the input vectors. More...
 
static IntVector2 Min (IntVector2 a, IntVector2 b)
 Returns a new IntVector2 with the smallest components of the input vectors. More...
 
static implicit operator FPVector2 (IntVector2 v)
 Implicitly converts a IntVector2 instance to an FPVector2 instance. This conversion creates a new FPVector2 instance with the X and Y coordinates from the input IntVector2 instance. More...
 
static operator IntVector2 (FPVector2 v)
 Converts a FPVector2 instance to a IntVector2 instance. More...
 
static bool operator!= (IntVector2 lhs, IntVector2 rhs)
 Compares two IntVector2 instances for inequality. More...
 
static IntVector2 operator* (int d, IntVector2 a)
 Multiplies a IntVector2 by an integer scalar. More...
 
static IntVector2 operator* (IntVector2 a, int d)
 Multiplies a IntVector2 by an integer scalar. More...
 
static IntVector2 operator+ (IntVector2 a, IntVector2 b)
 Adds two IntVector2 instances. More...
 
static IntVector2 operator- (IntVector2 a)
 Negates an IntVector2. More...
 
static IntVector2 operator- (IntVector2 a, IntVector2 b)
 Subtracts the second IntVector2 from the first. More...
 
static IntVector2 operator/ (IntVector2 a, int d)
 Divides a IntVector2 by an integer scalar. More...
 
static bool operator== (IntVector2 lhs, IntVector2 rhs)
 Compares two IntVector2 instances for equality. More...
 
static IntVector2 RoundToInt (FPVector2 v)
 Rounds a FPVector2 to the nearest whole numbers, and returns a new IntVector2. More...
 
static void Serialize (void *ptr, IDeterministicFrameSerializer serializer)
 Serializes or deserializes a IntVector2 struct using the provided IDeterministicFrameSerializer object. More...
 

Public Attributes

int X
 The X component of the vector. More...
 
int Y
 The Y component of the vector. More...
 

Static Public Attributes

static IntVector2 Down => new IntVector2(0, -1)
 A vector with components (0,-1); More...
 
static IntVector2 Left => new IntVector2(-1, 0)
 A vector with components (-1,0); More...
 
static IntVector2 MaxValue => new IntVector2(int.MaxValue, int.MaxValue)
 A vector with components (int.MaxValue, int.MaxValue); More...
 
static IntVector2 MinValue => new IntVector2(int.MinValue, int.MinValue)
 A vector with components (int.MinValue, int.MinValue); More...
 
static IntVector2 One => new IntVector2(1, 1)
 A vector with components (1,1); More...
 
static IntVector2 Right => new IntVector2(1, 0)
 A vector with components (1,0); More...
 
const int SIZE = sizeof(int) * 2
 The size of the struct in memory. More...
 
static IntVector2 Up => new IntVector2(0, 1)
 A vector with components (0,1); More...
 
static IntVector2 Zero => new IntVector2(0, 0)
 A vector with components (0,0); More...
 

Properties

FP Magnitude [get]
 Gets the magnitude of the vector. More...
 
IntVector3 OXY [get]
 Returns vector (0, X, Y). More...
 
int SqrMagnitude [get]
 Gets the squared magnitude of the vector. More...
 
IntVector3 XOY [get]
 Returns vector (X, 0, Y). More...
 
IntVector2 XX [get]
 Returns a new IntVector2 using the X and X components of this vector. More...
 
IntVector3 XXX [get]
 Returns a new IntVector3 using the X, X and X components of this vector. More...
 
IntVector3 XXY [get]
 Returns a new IntVector3 using the X, X and Y components of this vector. More...
 
IntVector2 XY [get]
 Returns a new IntVector2 using the X and Y components of this vector. More...
 
IntVector3 XYO [get]
 Returns vector (X, Y, 0). More...
 
IntVector3 XYX [get]
 Returns a new IntVector3 using the X, Y and X components of this vector. More...
 
IntVector3 XYY [get]
 Returns a new IntVector3 using the X, Y and Y components of this vector. More...
 
IntVector2 YX [get]
 Returns a new IntVector2 using the Y and X components of this vector. More...
 
IntVector3 YXX [get]
 Returns a new IntVector3 using the Y, X and X components of this vector. More...
 
IntVector3 YXY [get]
 Returns a new IntVector3 using the Y, X and Y components of this vector. More...
 
IntVector2 YY [get]
 Returns a new IntVector2 using the Y and Y components of this vector. More...
 
IntVector3 YYX [get]
 Returns a new IntVector3 using the Y, Y and X components of this vector. More...
 
IntVector3 YYY [get]
 Returns a new IntVector3 using the Y, Y and Y components of this vector. More...
 

Detailed Description

Represents a two-dimensional vector with integer components.

Constructor & Destructor Documentation

◆ IntVector2()

Photon.Deterministic.IntVector2.IntVector2 ( int  x,
int  y 
)
inline

Initializes a new instance of the IntVector2 struct.

Parameters
xThe x-coordinate of the vector.
yThe y-coordinate of the vector.

Member Function Documentation

◆ GetHashCode()

override int Photon.Deterministic.IntVector2.GetHashCode ( )
inline

Returns a hash code for this instance.

◆ ToString()

override string Photon.Deterministic.IntVector2.ToString ( )
inline

Returns a string that represents the current IntVector2.

Returns
A string that represents the current IntVector2.

◆ Serialize()

static void Photon.Deterministic.IntVector2.Serialize ( void *  ptr,
IDeterministicFrameSerializer  serializer 
)
inlinestatic

Serializes or deserializes a IntVector2 struct using the provided IDeterministicFrameSerializer object.

Parameters
ptrA pointer to the IntVector2 struct to serialize or deserialize.
serializerThe IDeterministicFrameSerializer object used for serialization or deserialization.

◆ Clamp()

static IntVector2 Photon.Deterministic.IntVector2.Clamp ( IntVector2  value,
IntVector2  min,
IntVector2  max 
)
inlinestatic

Clamps a IntVector2 value between a minimum and maximum value.

Parameters
valueThe IntVector2 value to clamp
minThe minimum IntVector2 value to clamp to
maxThe maximum IntVector2 value to clamp to
Returns
The clamped IntVector2 value

◆ Distance()

static FP Photon.Deterministic.IntVector2.Distance ( IntVector2  a,
IntVector2  b 
)
inlinestatic

Calculates the distance between two IntVector2 points.

Parameters
aThe first IntVector2 point
bThe second IntVector2 point
Returns
The distance between the two IntVector2 points

◆ Max()

static IntVector2 Photon.Deterministic.IntVector2.Max ( IntVector2  a,
IntVector2  b 
)
inlinestatic

Returns a new IntVector2 with the largest components of the input vectors.

◆ Min()

static IntVector2 Photon.Deterministic.IntVector2.Min ( IntVector2  a,
IntVector2  b 
)
inlinestatic

Returns a new IntVector2 with the smallest components of the input vectors.

◆ RoundToInt()

static IntVector2 Photon.Deterministic.IntVector2.RoundToInt ( FPVector2  v)
inlinestatic

Rounds a FPVector2 to the nearest whole numbers, and returns a new IntVector2.

Parameters
vThe FPVector2 to round.
Returns
A new IntVector2 with the rounded components of the input vector.

◆ FloorToInt()

static IntVector2 Photon.Deterministic.IntVector2.FloorToInt ( FPVector2  v)
inlinestatic

Returns the largest integer less than or equal to the specified floating-point number.

Parameters
vThe floating-point number.
Returns
The largest integer less than or equal to v .

◆ CeilToInt()

static IntVector2 Photon.Deterministic.IntVector2.CeilToInt ( FPVector2  v)
inlinestatic

Returns a new IntVector2 with the smallest integer greater than or equal to the components of the given FPVector2.

Parameters
vThe FPVector2 to ceil.
Returns
A new IntVector2 with the components ceil'd.

◆ operator FPVector2()

static implicit Photon.Deterministic.IntVector2.operator FPVector2 ( IntVector2  v)
inlinestatic

Implicitly converts a IntVector2 instance to an FPVector2 instance. This conversion creates a new FPVector2 instance with the X and Y coordinates from the input IntVector2 instance.

Parameters
vThe IntVector2 instance to convert.
Returns
A new FPVector2 instance with the X and Y coordinates from the input IntVector2 instance.

◆ operator IntVector2()

static Photon.Deterministic.IntVector2.operator IntVector2 ( FPVector2  v)
inlineexplicitstatic

Converts a FPVector2 instance to a IntVector2 instance.

◆ operator+()

static IntVector2 Photon.Deterministic.IntVector2.operator+ ( IntVector2  a,
IntVector2  b 
)
inlinestatic

Adds two IntVector2 instances.

◆ operator-() [1/2]

static IntVector2 Photon.Deterministic.IntVector2.operator- ( IntVector2  a,
IntVector2  b 
)
inlinestatic

Subtracts the second IntVector2 from the first.

◆ operator*() [1/2]

static IntVector2 Photon.Deterministic.IntVector2.operator* ( IntVector2  a,
int  d 
)
inlinestatic

Multiplies a IntVector2 by an integer scalar.

◆ operator*() [2/2]

static IntVector2 Photon.Deterministic.IntVector2.operator* ( int  d,
IntVector2  a 
)
inlinestatic

Multiplies a IntVector2 by an integer scalar.

Parameters
d
a
Returns

◆ operator/()

static IntVector2 Photon.Deterministic.IntVector2.operator/ ( IntVector2  a,
int  d 
)
inlinestatic

Divides a IntVector2 by an integer scalar.

◆ operator==()

static bool Photon.Deterministic.IntVector2.operator== ( IntVector2  lhs,
IntVector2  rhs 
)
inlinestatic

Compares two IntVector2 instances for equality.

◆ operator!=()

static bool Photon.Deterministic.IntVector2.operator!= ( IntVector2  lhs,
IntVector2  rhs 
)
inlinestatic

Compares two IntVector2 instances for inequality.

◆ operator-() [2/2]

static IntVector2 Photon.Deterministic.IntVector2.operator- ( IntVector2  a)
inlinestatic

Negates an IntVector2.

Parameters
a
Returns

◆ Equals() [1/2]

bool Photon.Deterministic.IntVector2.Equals ( IntVector2  other)
inline

Determines whether the specified IntVector2 is equal to the current IntVector2.

Parameters
otherThe IntVector2 to compare with the current IntVector2.
Returns
true if the specified IntVector2 is equal to the current IntVector2; otherwise, false.

◆ Equals() [2/2]

override bool Photon.Deterministic.IntVector2.Equals ( object  obj)
inline

Determines whether the specified object is equal to the current IntVector2.

Parameters
objThe object to compare with the current IntVector2.
Returns
true if the specified object is equal to the current IntVector2; otherwise, false.

Member Data Documentation

◆ SIZE

const int Photon.Deterministic.IntVector2.SIZE = sizeof(int) * 2
static

The size of the struct in memory.

◆ Zero

IntVector2 Photon.Deterministic.IntVector2.Zero => new IntVector2(0, 0)
static

A vector with components (0,0);

◆ One

IntVector2 Photon.Deterministic.IntVector2.One => new IntVector2(1, 1)
static

A vector with components (1,1);

◆ Right

IntVector2 Photon.Deterministic.IntVector2.Right => new IntVector2(1, 0)
static

A vector with components (1,0);

◆ Left

IntVector2 Photon.Deterministic.IntVector2.Left => new IntVector2(-1, 0)
static

A vector with components (-1,0);

◆ Up

IntVector2 Photon.Deterministic.IntVector2.Up => new IntVector2(0, 1)
static

A vector with components (0,1);

◆ Down

IntVector2 Photon.Deterministic.IntVector2.Down => new IntVector2(0, -1)
static

A vector with components (0,-1);

◆ MaxValue

IntVector2 Photon.Deterministic.IntVector2.MaxValue => new IntVector2(int.MaxValue, int.MaxValue)
static

A vector with components (int.MaxValue, int.MaxValue);

◆ MinValue

IntVector2 Photon.Deterministic.IntVector2.MinValue => new IntVector2(int.MinValue, int.MinValue)
static

A vector with components (int.MinValue, int.MinValue);

◆ X

int Photon.Deterministic.IntVector2.X

The X component of the vector.

◆ Y

int Photon.Deterministic.IntVector2.Y

The Y component of the vector.

Property Documentation

◆ XOY

IntVector3 Photon.Deterministic.IntVector2.XOY
get

Returns vector (X, 0, Y).

◆ XYO

IntVector3 Photon.Deterministic.IntVector2.XYO
get

Returns vector (X, Y, 0).

◆ OXY

IntVector3 Photon.Deterministic.IntVector2.OXY
get

Returns vector (0, X, Y).

◆ Magnitude

FP Photon.Deterministic.IntVector2.Magnitude
get

Gets the magnitude of the vector.

◆ SqrMagnitude

int Photon.Deterministic.IntVector2.SqrMagnitude
get

Gets the squared magnitude of the vector.

◆ XXX

IntVector3 Photon.Deterministic.IntVector2.XXX
get

Returns a new IntVector3 using the X, X and X components of this vector.

◆ XXY

IntVector3 Photon.Deterministic.IntVector2.XXY
get

Returns a new IntVector3 using the X, X and Y components of this vector.

◆ XYX

IntVector3 Photon.Deterministic.IntVector2.XYX
get

Returns a new IntVector3 using the X, Y and X components of this vector.

◆ XYY

IntVector3 Photon.Deterministic.IntVector2.XYY
get

Returns a new IntVector3 using the X, Y and Y components of this vector.

◆ XX

IntVector2 Photon.Deterministic.IntVector2.XX
get

Returns a new IntVector2 using the X and X components of this vector.

◆ XY

IntVector2 Photon.Deterministic.IntVector2.XY
get

Returns a new IntVector2 using the X and Y components of this vector.

◆ YYY

IntVector3 Photon.Deterministic.IntVector2.YYY
get

Returns a new IntVector3 using the Y, Y and Y components of this vector.

◆ YYX

IntVector3 Photon.Deterministic.IntVector2.YYX
get

Returns a new IntVector3 using the Y, Y and X components of this vector.

◆ YXY

IntVector3 Photon.Deterministic.IntVector2.YXY
get

Returns a new IntVector3 using the Y, X and Y components of this vector.

◆ YXX

IntVector3 Photon.Deterministic.IntVector2.YXX
get

Returns a new IntVector3 using the Y, X and X components of this vector.

◆ YY

IntVector2 Photon.Deterministic.IntVector2.YY
get

Returns a new IntVector2 using the Y and Y components of this vector.

◆ YX

IntVector2 Photon.Deterministic.IntVector2.YX
get

Returns a new IntVector2 using the Y and X components of this vector.