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

Constructor & Destructor Documentation

◆ Int4() [1/3]

DLLEXPORT Leviathan::Int4::Int4 ( )
inline

Definition at line 325 of file Types.h.

326  {
327  X = Y = Z = W = 0;
328  }

◆ Int4() [2/3]

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

Definition at line 329 of file Types.h.

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

◆ Int4() [3/3]

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

Definition at line 330 of file Types.h.

331  {
332  X = Y = Z = W = data;
333  }

Member Function Documentation

◆ AddAllTogether()

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

Definition at line 364 of file Types.h.

365  {
366  return X + Y + Z + W;
367  }

◆ operator+()

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

Definition at line 336 of file Types.h.

337  {
338  X += val.X;
339  Y += val.Y;
340  Z += val.Z;
341  W += val.W;
342  return *this;
343  }

◆ operator-()

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

Definition at line 356 of file Types.h.

357  {
358  X -= val.X;
359  Y -= val.Y;
360  Z -= val.Z;
361  W -= val.W;
362  return *this;
363  }

◆ operator[]()

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

Definition at line 344 of file Types.h.

345  {
346  switch(nIndex) {
347  case 0: return X;
348  case 1: return Y;
349  case 2: return Z;
350  case 3: return W;
351  }
352 
353  LEVIATHAN_ASSERT(0, "invalid Int4[] access");
354  return 0;
355  }

Member Data Documentation

◆ W

int Leviathan::Int4::W

Definition at line 370 of file Types.h.

◆ X

int Leviathan::Int4::X

Definition at line 370 of file Types.h.

◆ Y

int Leviathan::Int4::Y

Definition at line 370 of file Types.h.

◆ Z

int Leviathan::Int4::Z

Definition at line 370 of file Types.h.


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