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 127 of file Types.h.

Constructor & Destructor Documentation

◆ Int2() [1/4]

DLLEXPORT Leviathan::Int2::Int2 ( )
inline

Definition at line 129 of file Types.h.

130  {
131  X = 0;
132  Y = 0;
133  }

◆ Int2() [2/4]

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

Definition at line 134 of file Types.h.

135  {
136  X = x;
137  Y = y;
138  }

◆ Int2() [3/4]

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

Definition at line 139 of file Types.h.

140  {
141  X = data;
142  Y = data;
143  }

◆ Int2() [4/4]

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

Definition at line 144 of file Types.h.

145  {
146  X = other.X;
147  Y = other.Y;
148  }

Member Function Documentation

◆ operator!=()

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

Definition at line 239 of file Types.h.

240  {
241  return X != other.X && Y != other.Y;
242  };

◆ operator*() [1/2]

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

Definition at line 191 of file Types.h.

192  {
193  return Int2(X * val.X, Y * val.Y);
194  }
DLLEXPORT Int2()
Definition: Types.h:129

◆ operator*() [2/2]

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

Definition at line 196 of file Types.h.

197  {
198  return Int2(X * f, Y * f);
199  }
DLLEXPORT Int2()
Definition: Types.h:129

◆ operator*=()

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

Definition at line 201 of file Types.h.

202  {
203  X *= f;
204  Y *= f;
205  return this;
206  }

◆ operator+() [1/2]

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

Definition at line 151 of file Types.h.

152  {
153  return Int2(X + val.X, Y + val.Y);
154  }
DLLEXPORT Int2()
Definition: Types.h:129

◆ operator+() [2/2]

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

Definition at line 169 of file Types.h.

170  {
171  return Int2(X + val.X, Y + val.Y);
172  }
DLLEXPORT Int2()
Definition: Types.h:129

◆ operator+=()

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

Definition at line 174 of file Types.h.

175  {
176  X += val.X;
177  Y += val.Y;
178  return this;
179  }

◆ operator-() [1/2]

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

Definition at line 181 of file Types.h.

182  {
183  return Int2(X - val.X, Y - val.Y);
184  }
DLLEXPORT Int2()
Definition: Types.h:129

◆ operator-() [2/2]

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

Definition at line 186 of file Types.h.

187  {
188  return Int2(-X, -Y);
189  }
DLLEXPORT Int2()
Definition: Types.h:129

◆ operator/() [1/2]

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

Definition at line 208 of file Types.h.

209  {
210  return Int2(X / val.X, Y / val.Y);
211  }
DLLEXPORT Int2()
Definition: Types.h:129

◆ operator/() [2/2]

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

Definition at line 213 of file Types.h.

214  {
215  return Int2(X / f, Y / f);
216  }
DLLEXPORT Int2()
Definition: Types.h:129

◆ operator<()

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

Definition at line 219 of file Types.h.

220  {
221  return X < other.X && Y < other.Y;
222  };

◆ operator<=()

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

Definition at line 223 of file Types.h.

224  {
225  return X <= other.X && Y <= other.Y;
226  };

◆ operator==()

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

Definition at line 235 of file Types.h.

236  {
237  return X == other.X && Y == other.Y;
238  };

◆ operator>()

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

Definition at line 227 of file Types.h.

228  {
229  return X > other.X && Y > other.Y;
230  };

◆ operator>=()

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

Definition at line 231 of file Types.h.

232  {
233  return X >= other.X && Y >= other.Y;
234  };

◆ operator[]()

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

Definition at line 156 of file Types.h.

157  {
158  switch(nIndex) {
159  case 0: return X;
160  case 1: return Y;
161  }
162 
163  LEVIATHAN_ASSERT(0, "invalid [] access");
164  return 0;
165  }
#define LEVIATHAN_ASSERT(x, msg)
Definition: Define.h:92

◆ SetData() [1/2]

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

Definition at line 246 of file Types.h.

247  {
248  X = data;
249  Y = data;
250  };

◆ SetData() [2/2]

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

Definition at line 251 of file Types.h.

252  {
253  X = data1;
254  Y = data2;
255  };

◆ VALUE_TYPE()

Leviathan::Int2::VALUE_TYPE ( Int2  )

Member Data Documentation

◆ X

int Leviathan::Int2::X

Definition at line 259 of file Types.h.

◆ Y

int Leviathan::Int2::Y

Definition at line 259 of file Types.h.


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