Empeld
Empeld plugin documentation.
pluginbase.Helpers.Coords.Box2i Struct Reference
Inheritance diagram for pluginbase.Helpers.Coords.Box2i:

Public Member Functions

 Box2i (int x, int y, int width, int height)
 
 Box2i (Vector2i point, Vector2i size)
 
Box2i Intersect (Box2i box)
 
override bool Equals (object obj)
 
bool Equals (Box2i box)
 
override int GetHashCode ()
 
override string ToString ()
 

Static Public Member Functions

static Box2i FromPoints (Vector2i a, Vector2i b)
 
static Box2i FromPoints (int x1, int y1, int x2, int y2)
 

Public Attributes

Vector2i Point
 
Vector2i Size
 

Properties

int Area [get]
 
Vector2i Min [get]
 
Vector2i Max [get]
 
bool IsSquare [get]
 

Detailed Description

Attribute: StructLayout(LayoutKind.Sequential, Pack = 0)

Constructor & Destructor Documentation

◆ Box2i() [1/2]

pluginbase.Helpers.Coords.Box2i.Box2i ( int  x,
int  y,
int  width,
int  height 
)
42  {
43  this.Point = new Vector2i(x,y);
44  this.Size = new Vector2i(width,height);
45  }
static readonly Vector2i new Vector2i(1, 1)
Vector2i Point
Definition: Box2i.cs:9
Vector2i Size
Definition: Box2i.cs:10

◆ Box2i() [2/2]

pluginbase.Helpers.Coords.Box2i.Box2i ( Vector2i  point,
Vector2i  size 
)
48  {
49  this.Point = point;
50  this.Size = size;
51  }
Vector2i Point
Definition: Box2i.cs:9
Vector2i Size
Definition: Box2i.cs:10

Member Function Documentation

◆ Equals() [1/2]

override bool pluginbase.Helpers.Coords.Box2i.Equals ( object  obj)
72  {
73  if (obj is Box2i)
74  return this.Equals((Box2i)obj);
75  return false;
76  }
Box2i(int x, int y, int width, int height)
Definition: Box2i.cs:41
override bool Equals(object obj)
Definition: Box2i.cs:71

◆ Equals() [2/2]

bool pluginbase.Helpers.Coords.Box2i.Equals ( Box2i  box)
79  {
80  return this.Point.Equals(box.Point) && this.Size.Equals(box.Size);
81  }
Vector2i Point
Definition: Box2i.cs:9
Vector2i Size
Definition: Box2i.cs:10

◆ FromPoints() [1/2]

static Box2i pluginbase.Helpers.Coords.Box2i.FromPoints ( Vector2i  a,
Vector2i  b 
)
static
54  {
55  return new Box2i(a, b - a);
56  }
Box2i(int x, int y, int width, int height)
Definition: Box2i.cs:41

◆ FromPoints() [2/2]

static Box2i pluginbase.Helpers.Coords.Box2i.FromPoints ( int  x1,
int  y1,
int  x2,
int  y2 
)
static
59  {
60  return new Box2i(x1, y1, x2 - x1, y2 - y1);
61  }
Box2i(int x, int y, int width, int height)
Definition: Box2i.cs:41

◆ GetHashCode()

override int pluginbase.Helpers.Coords.Box2i.GetHashCode ( )
84  {
85  return this.Point.GetHashCode() ^ this.Size.GetHashCode();
86  }
Vector2i Point
Definition: Box2i.cs:9
Vector2i Size
Definition: Box2i.cs:10

◆ Intersect()

Box2i pluginbase.Helpers.Coords.Box2i.Intersect ( Box2i  box)
64  {
65  return Box2i.FromPoints(
66  Vector2i.ComponentMax(this.Min, box.Min),
67  Vector2i.ComponentMin(this.Max, box.Max)
68  );
69  }
static readonly Vector2i new Vector2i(1, 1)
Box2i(int x, int y, int width, int height)
Definition: Box2i.cs:41
Vector2i Max
Definition: Box2i.cs:29

◆ ToString()

override string pluginbase.Helpers.Coords.Box2i.ToString ( )
89  {
90  return string.Format("[Box2i: Point={0}, Size={1}]", this.Point, this.Size);
91  }
Vector2i Point
Definition: Box2i.cs:9
Vector2i Size
Definition: Box2i.cs:10

Member Data Documentation

◆ Point

Vector2i pluginbase.Helpers.Coords.Box2i.Point

◆ Size

Vector2i pluginbase.Helpers.Coords.Box2i.Size

Property Documentation

◆ Area

int pluginbase.Helpers.Coords.Box2i.Area
get

◆ IsSquare

bool pluginbase.Helpers.Coords.Box2i.IsSquare
get

◆ Max

Vector2i pluginbase.Helpers.Coords.Box2i.Max
get

◆ Min

Vector2i pluginbase.Helpers.Coords.Box2i.Min
get

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