Add project files.

This commit is contained in:
2018-06-25 21:48:45 -04:00
parent b04a25689b
commit 3c1b7d28e8
425 changed files with 35333 additions and 0 deletions
@@ -0,0 +1,98 @@
#include "iVector2.hpp"
/*** Custom Header File ***/
#include "../Vector/Vector2.hpp"
using MathEngine::iVector2;
using MathEngine::Vector2;
iVector2::iVector2( const int X /*= 0*/, const int Y /*= 0*/ )
: x(X), y(Y)
{}
iVector2::iVector2( const Vector2& copy )
{
x = int(copy.x);
y = int(copy.y);
}
iVector2::iVector2( const SDL_Rect& copy )
{
x = int(copy.x);
y = int(copy.y);
}
iVector2& iVector2::operator = ( const Vector2& copy )
{
x = int(copy.x);
y = int(copy.y);
return *this;
}
iVector2& iVector2::operator = ( const SDL_Rect& copy )
{
x = int(copy.x);
y = int(copy.y);
return *this;
}
bool iVector2::operator == ( const iVector2& other ) const
{
bool rtn = false;
if (x == other.x)
if (y == other.y)
rtn = true;
return rtn;
}
bool iVector2::operator == ( const SDL_Rect& other ) const
{
bool rtn = false;
if (x == other.x)
if (y == other.y)
rtn = true;
return rtn;
}
iVector2& iVector2::operator += ( const iVector2& other )
{
x += int(other.x);
y += int(other.y);
return *this;
}
iVector2& iVector2::operator += ( const SDL_Rect& other )
{
x += int(other.x);
y += int(other.y);
return *this;
}
iVector2& iVector2::operator -= (const iVector2& other)
{
x -= int(other.x);
y -= int(other.y);
return *this;
}
iVector2& iVector2::operator -= (const SDL_Rect& other)
{
x -= int(other.x);
y -= int(other.y);
return *this;
}
iVector2 operator + (const iVector2& lhs, const iVector2& rhs)
{
iVector2 rs = lhs;
rs += rhs;
return rs;
}