Empeld
Empeld plugin documentation.
Vector2i.cs File Reference

Classes

struct  pluginbase.Helpers.Coords.Vector2i
 A 2d struct of integers More...
 

Namespaces

namespace  pluginbase.Helpers.Coords
 

Functions

static readonly Vector2i new pluginbase.Helpers.Coords.Vector2i (1, 1)
 
static readonly Vector2i new new pluginbase.Helpers.Coords.Vector2i (1,-1)
 
static readonly Vector2i new new new pluginbase.Helpers.Coords.Vector2i (-1,-1)
 
static Vector2i ComponentMax (Vector2i a, Vector2i b)
 
static Vector2i ComponentMin (Vector2i a, Vector2i b)
 
static Vector2i operator+ (Vector2i left, Vector2i right)
 
static Vector2i operator- (Vector2i left, Vector2i right)
 
static Vector2i operator- (Vector2i val)
 
static Vector2i operator* (Vector2i v, Vector2i w)
 
static Vector2i operator* (Vector2i v, int c)
 
static Vector2i operator* (int c, Vector2i v)
 
static Vector2i operator/ (Vector2i v, Vector2i w)
 
static Vector2i operator/ (Vector2i v, int c)
 
static Vector2 operator* (Vector2i left, float right)
 
static Vector2 operator* (float left, Vector2i right)
 
static Vector2d operator* (Vector2i left, double right)
 
static Vector2d operator* (double left, Vector2i right)
 
static bool operator== (Vector2i left, Vector2i right)
 
static bool operator!= (Vector2i left, Vector2i right)
 
static implicit operator Vector2d (Vector2i vec)
 
static implicit operator Vector2 (Vector2i vec)
 
static operator Vector2i (Vector2 vec)
 
static operator Vector2i (Vector2d vec)
 
bool Equals (Vector2i other)
 Determines whether the specified Vector2i is equal to the current Vector2i. More...
 
override bool Equals (object obj)
 Determines whether the specified System.Object is equal to the current Vector2i. More...
 
override int GetHashCode ()
 Serves as a hash function for a Vector2i object. More...
 
override string ToString ()
 Returns a System.String that represents the current Vector2i. More...
 

Variables

static readonly Vector2i pluginbase.Helpers.Coords.UnitX
 Enumerates all the axis-aligned and diagnol directions (Not unit-length) eg (1,0),(1,1),(0,1),(-1,1),etc More...
 
static readonly Vector2i pluginbase.Helpers.Coords.UnitY
 
Vector2i PerpendicularLeft [get]
 
Vector2i PerpendicularRight [get]
 
Vector2 Center [get]
 
Vector2d Centerd [get]
 
int LengthSquared [get]
 
float Length [get]
 
double Lengthd [get]
 

Function Documentation

◆ ComponentMax()

static Vector2i ComponentMax ( Vector2i  a,
Vector2i  b 
)
static
73  {
74  return new Vector2i(
75  Math.Max(a.X, b.X),
76  Math.Max(a.Y, b.Y)
77  );
78  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ ComponentMin()

static Vector2i ComponentMin ( Vector2i  a,
Vector2i  b 
)
static
81  {
82  return new Vector2i(
83  Math.Min(a.X, b.X),
84  Math.Min(a.Y, b.Y)
85  );
86  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ Equals() [1/2]

bool Equals ( Vector2i  other)

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

Parameters
otherThe Vector2i to compare with the current Vector2i.
Returns
true if the specified Vector2i is equal to the current Vector2i; otherwise, false.
249  {
250  return this.X == other.X && this.Y == other.Y;
251  }

◆ Equals() [2/2]

override bool Equals ( object  obj)

Determines whether the specified System.Object is equal to the current Vector2i.

Parameters
objThe System.Object to compare with the current Vector2i.
Returns
true if the specified System.Object is equal to the current Vector2i; otherwise, false.
260  {
261  if (obj is Vector2i)
262  {
263  return this.Equals ((Vector2i)obj);
264  }
265  return false;
266  }
bool Equals(Vector2i other)
Determines whether the specified Vector2i is equal to the current Vector2i.
Definition: Vector2i.cs:248
static readonly Vector2i new new new Vector2i(-1,-1)

◆ GetHashCode()

override int GetHashCode ( )

Serves as a hash function for a Vector2i object.

Returns
A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.
273  {
274  return X ^ Y;
275  }

◆ operator Vector2()

static implicit operator Vector2 ( Vector2i  vec)
static
228  {
229  return new Vector2 (vec.X, vec.Y);
230  }

◆ operator Vector2d()

static implicit operator Vector2d ( Vector2i  vec)
static
223  {
224  return new Vector2d (vec.X, vec.Y);
225  }

◆ operator Vector2i() [1/2]

static operator Vector2i ( Vector2  vec)
explicitstatic
233  {
234  return new Vector2i ((int)vec.X, (int)vec.Y);
235  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ operator Vector2i() [2/2]

static operator Vector2i ( Vector2d  vec)
explicitstatic
238  {
239  return new Vector2i ((int)vec.X, (int)vec.Y);
240  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ operator!=()

static bool operator!= ( Vector2i  left,
Vector2i  right 
)
static
218  {
219  return left.X != right.X || left.Y != right.Y;
220  }

◆ operator*() [1/7]

static Vector2i operator* ( Vector2i  v,
Vector2i  w 
)
static
162  {
163  return new Vector2i(v.X * w.X, v.Y * w.Y);
164  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ operator*() [2/7]

static Vector2i operator* ( Vector2i  v,
int  c 
)
static
167  {
168  return new Vector2i(v.X * c, v.Y * c);
169  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ operator*() [3/7]

static Vector2i operator* ( int  c,
Vector2i  v 
)
static
172  {
173  return new Vector2i(v.X * c, v.Y * c);
174  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ operator*() [4/7]

static Vector2 operator* ( Vector2i  left,
float  right 
)
static
191  {
192  return new Vector2 (left.X * right, left.Y * right);
193  }

◆ operator*() [5/7]

static Vector2 operator* ( float  left,
Vector2i  right 
)
static
196  {
197  return new Vector2 (left * right.X, left * right.Y);
198  }

◆ operator*() [6/7]

static Vector2d operator* ( Vector2i  left,
double  right 
)
static
201  {
202  return new Vector2d (left.X * right, left.Y * right);
203  }

◆ operator*() [7/7]

static Vector2d operator* ( double  left,
Vector2i  right 
)
static
206  {
207  return new Vector2d (left * right.X, left * right.Y);
208  }

◆ operator+()

static Vector2i operator+ ( Vector2i  left,
Vector2i  right 
)
static
147  {
148  return new Vector2i(left.X + right.X, left.Y + right.Y);
149  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ operator-() [1/2]

static Vector2i operator- ( Vector2i  left,
Vector2i  right 
)
static
152  {
153  return new Vector2i(left.X - right.X, left.Y - right.Y);
154  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ operator-() [2/2]

static Vector2i operator- ( Vector2i  val)
static
157  {
158  return new Vector2i (-val.X, -val.Y);
159  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ operator/() [1/2]

static Vector2i operator/ ( Vector2i  v,
Vector2i  w 
)
static
177  {
178  return new Vector2i(v.X / w.X, v.Y / w.Y);
179  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ operator/() [2/2]

static Vector2i operator/ ( Vector2i  v,
int  c 
)
static
182  {
183  return new Vector2i(v.X / c, v.Y / c);
184  }
static readonly Vector2i new new new Vector2i(-1,-1)

◆ operator==()

static bool operator== ( Vector2i  left,
Vector2i  right 
)
static
213  {
214  return left.X == right.X && left.Y == right.Y;
215  }

◆ ToString()

override string ToString ( )

Returns a System.String that represents the current Vector2i.

Returns
A System.String that represents the current Vector2i.
282  {
283  return string.Format ("({0}, {1})", this.X, this.Y);
284  }

Variable Documentation

◆ Center

Vector2 Center
get

◆ Centerd

Vector2d Centerd
get

◆ Length

float Length
get

◆ Lengthd

double Lengthd
get

◆ LengthSquared

int LengthSquared
get

◆ PerpendicularLeft

Vector2i PerpendicularLeft
get

◆ PerpendicularRight

Vector2i PerpendicularRight
get