Core 1.0
Vec2I Class Reference

Point in three dimensions with integer coordinates. More...

#include <ivector.h>

Public Member Functions

 Vec2I ()
 Empty.
 
 Vec2I (int)
 Create a vector with the same coordinates.
 
 Vec2I (int, int)
 Create a vector with argument coordinates.
 
 Vec2I (const Vector2 &)
 Create a vector.
 
int & operator[] (int)
 Gets the i-th coordinate of vector.
 
constexpr int operator[] (int) const
 Returns the i-th coordinate of vector.
 
Vec2I operator+ () const
 Overloaded.
 
Vec2I operator- () const
 Overloaded.
 
Vec2Ioperator+= (const Vec2I &)
 Destructive addition.
 
Vec2Ioperator-= (const Vec2I &)
 Destructive subtraction.
 
Vec2Ioperator*= (int)
 Destructive scalar multiply.
 
Vec2I operator* (int) const
 Multiply.
 
Vec2I operator>> (int) const
 Shift.
 
Vec2I operator^ (const Vec2I &) const
 Shift.
 
QString ToString () const
 Create a QString form a integer vector.
 

Protected Attributes

int c [2] = { 0,0 }
 Integer coordinates.
 

Friends

Vec2I operator+ (const Vec2I &u, const Vec2I &v)
 Adds up two vectors.
 
Vec2I operator- (const Vec2I &u, const Vec2I &v)
 Difference between two vectors.
 
bool operator== (const Vec2I &u, const Vec2I &v)
 Strong equality test.
 
bool operator!= (const Vec2I &u, const Vec2I &v)
 Strong difference test.
 
std::ostream & operator<< (std::ostream &s, const Vec2I &u)
 Overloaded output-stream operator.
 

Detailed Description

Point in three dimensions with integer coordinates.

Constructor & Destructor Documentation

◆ Vec2I() [1/3]

Vec2I::Vec2I ( int a)
inlineexplicit

Create a vector with the same coordinates.

Parameters
aInteger.

◆ Vec2I() [2/3]

Vec2I::Vec2I ( int a,
int b )
inlineexplicit

Create a vector with argument coordinates.

Parameters
a,bCoordinates.

◆ Vec2I() [3/3]

Vec2I::Vec2I ( const Vector2 & v)
inlineexplicit

Create a vector.

Parameters
vVector.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & s,
const Vec2I & u )
friend

Overloaded output-stream operator.

Parameters
uVector.
sStream.