Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Int3 Struct Reference

#include <Types.h>

Public Member Functions

DLLEXPORT Int3 ()
 
DLLEXPORT Int3 (int x, int y, int z)
 
DLLEXPORT Int3 (int data)
 
DLLEXPORT Int3 operator+ (const Int3 &val) const
 
DLLEXPORT Int3 operator* (int val) const
 
DLLEXPORT int operator[] (const int nIndex) const
 
DLLEXPORT Int3 operator- (const Int3 &other) const
 
DLLEXPORT Int3operator*= (int f)
 
DLLEXPORT int AddAllTogether () const
 
 VALUE_TYPE (Int3)
 

Public Attributes

int X
 
int Y
 
int Z
 

Detailed Description

Definition at line 256 of file Types.h.

Constructor & Destructor Documentation

◆ Int3() [1/3]

DLLEXPORT Leviathan::Int3::Int3 ( )
inline

Definition at line 258 of file Types.h.

259  {
260  X = 0;
261  Y = 0;
262  Z = 0;
263  }

◆ Int3() [2/3]

DLLEXPORT Leviathan::Int3::Int3 ( int  x,
int  y,
int  z 
)
inline

Definition at line 264 of file Types.h.

265  {
266  X = x;
267  Y = y;
268  Z = z;
269  }

◆ Int3() [3/3]

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

Definition at line 270 of file Types.h.

271  {
272  // save a bit of space //
273  X = Y = Z = data;
274  }

Member Function Documentation

◆ AddAllTogether()

DLLEXPORT int Leviathan::Int3::AddAllTogether ( ) const
inline

Definition at line 311 of file Types.h.

312  {
313  return X + Y + Z;
314  }

◆ operator*()

DLLEXPORT Int3 Leviathan::Int3::operator* ( int  val) const
inline

Definition at line 282 of file Types.h.

283  {
284  return Int3(X * val, Y * val, Z * val);
285  }
DLLEXPORT Int3()
Definition: Types.h:258

◆ operator*=()

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

Definition at line 303 of file Types.h.

304  {
305  X *= f;
306  Y *= f;
307  Z *= f;
308  return this;
309  }

◆ operator+()

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

Definition at line 277 of file Types.h.

278  {
279  return Int3(X + val.X, Y + val.Y, Z + val.Z);
280  }
DLLEXPORT Int3()
Definition: Types.h:258

◆ operator-()

DLLEXPORT Int3 Leviathan::Int3::operator- ( const Int3 other) const
inline

Definition at line 298 of file Types.h.

299  {
300  return Int3(X - other.X, Y - other.Y, Z - other.Z);
301  }
DLLEXPORT Int3()
Definition: Types.h:258

◆ operator[]()

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

Definition at line 287 of file Types.h.

288  {
289  switch(nIndex) {
290  case 0: return X;
291  case 1: return Y;
292  case 2: return Z;
293  }
294 
295  LEVIATHAN_ASSERT(0, "invalid Int3[] access");
296  return 0;
297  }

◆ VALUE_TYPE()

Leviathan::Int3::VALUE_TYPE ( Int3  )

Member Data Documentation

◆ X

int Leviathan::Int3::X

Definition at line 320 of file Types.h.

◆ Y

int Leviathan::Int3::Y

Definition at line 320 of file Types.h.

◆ Z

int Leviathan::Int3::Z

Definition at line 320 of file Types.h.


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