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

Constructor & Destructor Documentation

◆ Int3() [1/3]

DLLEXPORT Leviathan::Int3::Int3 ( )
inline

Definition at line 264 of file Types.h.

265  {
266  X = 0;
267  Y = 0;
268  Z = 0;
269  }

◆ Int3() [2/3]

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

Definition at line 270 of file Types.h.

271  {
272  X = x;
273  Y = y;
274  Z = z;
275  }

◆ Int3() [3/3]

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

Definition at line 276 of file Types.h.

277  {
278  // save a bit of space //
279  X = Y = Z = data;
280  }

Member Function Documentation

◆ AddAllTogether()

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

Definition at line 317 of file Types.h.

318  {
319  return X + Y + Z;
320  }

◆ operator*()

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

Definition at line 288 of file Types.h.

289  {
290  return Int3(X * val, Y * val, Z * val);
291  }
DLLEXPORT Int3()
Definition: Types.h:264

◆ operator*=()

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

Definition at line 309 of file Types.h.

310  {
311  X *= f;
312  Y *= f;
313  Z *= f;
314  return this;
315  }

◆ operator+()

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

Definition at line 283 of file Types.h.

284  {
285  return Int3(X + val.X, Y + val.Y, Z + val.Z);
286  }
DLLEXPORT Int3()
Definition: Types.h:264

◆ operator-()

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

Definition at line 304 of file Types.h.

305  {
306  return Int3(X - other.X, Y - other.Y, Z - other.Z);
307  }
DLLEXPORT Int3()
Definition: Types.h:264

◆ operator[]()

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

Definition at line 293 of file Types.h.

294  {
295  switch(nIndex) {
296  case 0: return X;
297  case 1: return Y;
298  case 2: return Z;
299  }
300 
301  LEVIATHAN_ASSERT(0, "invalid Int3[] access");
302  return 0;
303  }
#define LEVIATHAN_ASSERT(x, msg)
Definition: Define.h:92

◆ VALUE_TYPE()

Leviathan::Int3::VALUE_TYPE ( Int3  )

Member Data Documentation

◆ X

int Leviathan::Int3::X

Definition at line 326 of file Types.h.

◆ Y

int Leviathan::Int3::Y

Definition at line 326 of file Types.h.

◆ Z

int Leviathan::Int3::Z

Definition at line 326 of file Types.h.


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