Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Int2 Struct Reference

#include <Types.h>

Public Member Functions

DLLEXPORT Int2 ()
 
DLLEXPORT Int2 (int x, int y)
 
DLLEXPORT Int2 (int data)
 
DLLEXPORT Int2 (const Int2 &other)
 
DLLEXPORT Int2 operator+ (const Int2 &val)
 
DLLEXPORT int operator[] (const int nIndex) const
 
DLLEXPORT Int2 operator+ (const Int2 &val) const
 
DLLEXPORT Int2operator+= (const Int2 &val)
 
DLLEXPORT Int2 operator- (const Int2 &val) const
 
DLLEXPORT Int2 operator- () const
 
DLLEXPORT Int2 operator* (const Int2 &val) const
 
DLLEXPORT Int2 operator* (int f) const
 
DLLEXPORT Int2operator*= (int f)
 
DLLEXPORT Int2 operator/ (const Int2 &val) const
 
DLLEXPORT Int2 operator/ (int f) const
 
DLLEXPORT bool operator< (const Int2 &other) const
 
DLLEXPORT bool operator<= (const Int2 &other) const
 
DLLEXPORT bool operator> (const Int2 &other) const
 
DLLEXPORT bool operator>= (const Int2 &other) const
 
DLLEXPORT bool operator== (const Int2 &other) const
 
DLLEXPORT bool operator!= (const Int2 &other) const
 
DLLEXPORT void SetData (const int &data)
 
DLLEXPORT void SetData (const int &data1, const int &data2)
 
 VALUE_TYPE (Int2)
 

Public Attributes

int X
 
int Y
 

Detailed Description

Definition at line 121 of file Types.h.

Constructor & Destructor Documentation

◆ Int2() [1/4]

DLLEXPORT Leviathan::Int2::Int2 ( )
inline

Definition at line 123 of file Types.h.

124  {
125  X = 0;
126  Y = 0;
127  }

◆ Int2() [2/4]

DLLEXPORT Leviathan::Int2::Int2 ( int  x,
int  y 
)
inline

Definition at line 128 of file Types.h.

129  {
130  X = x;
131  Y = y;
132  }

◆ Int2() [3/4]

DLLEXPORT Leviathan::Int2::Int2 ( int  data)
inlineexplicit

Definition at line 133 of file Types.h.

134  {
135  X = data;
136  Y = data;
137  }

◆ Int2() [4/4]

DLLEXPORT Leviathan::Int2::Int2 ( const Int2 other)
inline

Definition at line 138 of file Types.h.

139  {
140  X = other.X;
141  Y = other.Y;
142  }

Member Function Documentation

◆ operator!=()

DLLEXPORT bool Leviathan::Int2::operator!= ( const Int2 other) const
inline

Definition at line 233 of file Types.h.

234  {
235  return X != other.X && Y != other.Y;
236  };

◆ operator*() [1/2]

DLLEXPORT Int2 Leviathan::Int2::operator* ( const Int2 val) const
inline

Definition at line 185 of file Types.h.

186  {
187  return Int2(X * val.X, Y * val.Y);
188  }
DLLEXPORT Int2()
Definition: Types.h:123

◆ operator*() [2/2]

DLLEXPORT Int2 Leviathan::Int2::operator* ( int  f) const
inline

Definition at line 190 of file Types.h.

191  {
192  return Int2(X * f, Y * f);
193  }
DLLEXPORT Int2()
Definition: Types.h:123

◆ operator*=()

DLLEXPORT Int2* Leviathan::Int2::operator*= ( int  f)
inline

Definition at line 195 of file Types.h.

196  {
197  X *= f;
198  Y *= f;
199  return this;
200  }

◆ operator+() [1/2]

DLLEXPORT Int2 Leviathan::Int2::operator+ ( const Int2 val)
inline

Definition at line 145 of file Types.h.

146  {
147  return Int2(X + val.X, Y + val.Y);
148  }
DLLEXPORT Int2()
Definition: Types.h:123

◆ operator+() [2/2]

DLLEXPORT Int2 Leviathan::Int2::operator+ ( const Int2 val) const
inline

Definition at line 163 of file Types.h.

164  {
165  return Int2(X + val.X, Y + val.Y);
166  }
DLLEXPORT Int2()
Definition: Types.h:123

◆ operator+=()

DLLEXPORT Int2* Leviathan::Int2::operator+= ( const Int2 val)
inline

Definition at line 168 of file Types.h.

169  {
170  X += val.X;
171  Y += val.Y;
172  return this;
173  }

◆ operator-() [1/2]

DLLEXPORT Int2 Leviathan::Int2::operator- ( const Int2 val) const
inline

Definition at line 175 of file Types.h.

176  {
177  return Int2(X - val.X, Y - val.Y);
178  }
DLLEXPORT Int2()
Definition: Types.h:123

◆ operator-() [2/2]

DLLEXPORT Int2 Leviathan::Int2::operator- ( ) const
inline

Definition at line 180 of file Types.h.

181  {
182  return Int2(-X, -Y);
183  }
DLLEXPORT Int2()
Definition: Types.h:123

◆ operator/() [1/2]

DLLEXPORT Int2 Leviathan::Int2::operator/ ( const Int2 val) const
inline

Definition at line 202 of file Types.h.

203  {
204  return Int2(X / val.X, Y / val.Y);
205  }
DLLEXPORT Int2()
Definition: Types.h:123

◆ operator/() [2/2]

DLLEXPORT Int2 Leviathan::Int2::operator/ ( int  f) const
inline

Definition at line 207 of file Types.h.

208  {
209  return Int2(X / f, Y / f);
210  }
DLLEXPORT Int2()
Definition: Types.h:123

◆ operator<()

DLLEXPORT bool Leviathan::Int2::operator< ( const Int2 other) const
inline

Definition at line 213 of file Types.h.

214  {
215  return X < other.X && Y < other.Y;
216  };

◆ operator<=()

DLLEXPORT bool Leviathan::Int2::operator<= ( const Int2 other) const
inline

Definition at line 217 of file Types.h.

218  {
219  return X <= other.X && Y <= other.Y;
220  };

◆ operator==()

DLLEXPORT bool Leviathan::Int2::operator== ( const Int2 other) const
inline

Definition at line 229 of file Types.h.

230  {
231  return X == other.X && Y == other.Y;
232  };

◆ operator>()

DLLEXPORT bool Leviathan::Int2::operator> ( const Int2 other) const
inline

Definition at line 221 of file Types.h.

222  {
223  return X > other.X && Y > other.Y;
224  };

◆ operator>=()

DLLEXPORT bool Leviathan::Int2::operator>= ( const Int2 other) const
inline

Definition at line 225 of file Types.h.

226  {
227  return X >= other.X && Y >= other.Y;
228  };

◆ operator[]()

DLLEXPORT int Leviathan::Int2::operator[] ( const int  nIndex) const
inline

Definition at line 150 of file Types.h.

151  {
152  switch(nIndex) {
153  case 0: return X;
154  case 1: return Y;
155  }
156 
157  LEVIATHAN_ASSERT(0, "invalid [] access");
158  return 0;
159  }

◆ SetData() [1/2]

DLLEXPORT void Leviathan::Int2::SetData ( const int &  data)
inline

Definition at line 240 of file Types.h.

241  {
242  X = data;
243  Y = data;
244  };

◆ SetData() [2/2]

DLLEXPORT void Leviathan::Int2::SetData ( const int &  data1,
const int &  data2 
)
inline

Definition at line 245 of file Types.h.

246  {
247  X = data1;
248  Y = data2;
249  };

◆ VALUE_TYPE()

Leviathan::Int2::VALUE_TYPE ( Int2  )

Member Data Documentation

◆ X

int Leviathan::Int2::X

Definition at line 253 of file Types.h.

◆ Y

int Leviathan::Int2::Y

Definition at line 253 of file Types.h.


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