Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Int4 Struct Reference

#include <Types.h>

Public Member Functions

DLLEXPORT Int4 ()
 
DLLEXPORT Int4 (int x, int y, int z, int w)
 
DLLEXPORT Int4 (int data)
 
DLLEXPORT Int4operator+ (const Int4 &val)
 
DLLEXPORT int operator[] (const int nIndex) const
 
DLLEXPORT Int4operator- (const Int4 &val)
 
DLLEXPORT int AddAllTogether () const
 

Public Attributes

int X
 
int Y
 
int Z
 
int W
 

Detailed Description

Definition at line 329 of file Types.h.

Constructor & Destructor Documentation

◆ Int4() [1/3]

DLLEXPORT Leviathan::Int4::Int4 ( )
inline

Definition at line 331 of file Types.h.

332  {
333  X = Y = Z = W = 0;
334  }

◆ Int4() [2/3]

DLLEXPORT Leviathan::Int4::Int4 ( int  x,
int  y,
int  z,
int  w 
)
inline

Definition at line 335 of file Types.h.

335 : X(x), Y(y), Z(z), W(w) {}

◆ Int4() [3/3]

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

Definition at line 336 of file Types.h.

337  {
338  X = Y = Z = W = data;
339  }

Member Function Documentation

◆ AddAllTogether()

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

Definition at line 370 of file Types.h.

371  {
372  return X + Y + Z + W;
373  }

◆ operator+()

DLLEXPORT Int4& Leviathan::Int4::operator+ ( const Int4 val)
inline

Definition at line 342 of file Types.h.

343  {
344  X += val.X;
345  Y += val.Y;
346  Z += val.Z;
347  W += val.W;
348  return *this;
349  }

◆ operator-()

DLLEXPORT Int4& Leviathan::Int4::operator- ( const Int4 val)
inline

Definition at line 362 of file Types.h.

363  {
364  X -= val.X;
365  Y -= val.Y;
366  Z -= val.Z;
367  W -= val.W;
368  return *this;
369  }

◆ operator[]()

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

Definition at line 350 of file Types.h.

351  {
352  switch(nIndex) {
353  case 0: return X;
354  case 1: return Y;
355  case 2: return Z;
356  case 3: return W;
357  }
358 
359  LEVIATHAN_ASSERT(0, "invalid Int4[] access");
360  return 0;
361  }
#define LEVIATHAN_ASSERT(x, msg)
Definition: Define.h:92

Member Data Documentation

◆ W

int Leviathan::Int4::W

Definition at line 376 of file Types.h.

◆ X

int Leviathan::Int4::X

Definition at line 376 of file Types.h.

◆ Y

int Leviathan::Int4::Y

Definition at line 376 of file Types.h.

◆ Z

int Leviathan::Int4::Z

Definition at line 376 of file Types.h.


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