/* ========================================================================== * ÆÄ ÀÏ : UIPos.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : À̼ø±Ô * ÀÛ ¼º ÀÏ : 2006.09.30 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once /// UI ³ëµåÀÇ À§Ä¡ template class tUIPos { public: tUIPos( T x, T y ); tUIPos(); tUIPos( const tUIPos& other ); tUIPos operator + ( const tUIPos& other ) const; tUIPos operator - ( const tUIPos& other ) const; const tUIPos& operator = ( const tUIPos& other ); const tUIPos& operator += ( const tUIPos& other ); const tUIPos& operator -= ( const tUIPos& other ); bool operator == ( const tUIPos& other ) const; bool operator != ( const tUIPos& other ) const; public: T mX; T mY; }; template inline tUIPos::tUIPos( T x, T y ) : mX( x ) , mY( y ) { } template inline tUIPos::tUIPos() : mX( 0 ) , mY( 0 ) { } template inline tUIPos::tUIPos( const tUIPos& other ) : mX( other.mX ) , mY( other.mY ) { } template inline tUIPos tUIPos::operator + ( const tUIPos& other ) const { return tUIPos( mX+other.mX, mY+other.mY ); } template inline tUIPos tUIPos::operator - ( const tUIPos& other ) const { return tUIPos( mX-other.mX, mY-other.mY ); } template inline const tUIPos& tUIPos::operator = ( const tUIPos& other ) { mX = other.mX; mY = other.mY; return *this; } template inline const tUIPos& tUIPos::operator += ( const tUIPos& other ) { mX += other.mX; mY += other.mY; return *this; } template inline const tUIPos& tUIPos::operator -= ( const tUIPos& other ) { mX -= other.mX; mY -= other.mY; return *this; } template inline bool tUIPos::operator == ( const tUIPos& other ) const { return mX == other.mX && mY == other.mY; } template inline bool tUIPos::operator != ( const tUIPos& other ) const { return mX != other.mX || mY != other.mY; }