//------------------------------------------------------------------------------ // Author: Gero Mueller // Copyright: (c) 2006 Gero Mueller // License: MIT License //------------------------------------------------------------------------------ #ifndef BLUECORE_POINT_H #define BLUECORE_POINT_H #include "rectangle.h" namespace BlueCore { template struct Rectangle2DTemplate; template struct Point2DTemplate { type _x, _y; Point2DTemplate() : _x(0), _y(0) { } Point2DTemplate( type x, type y ) : _x(x), _y(y) { } bool in( const Rectangle2DTemplate &rect ); }; #include "rectangle.h" template bool Point2DTemplate::in( const Rectangle2DTemplate &rect ) { if( _x < rect._x ) return false; if( _x > (rect._x + rect._width) ) return false; if( _y < rect._y ) return false; if( _y > (rect._y + rect._height) ) return false; return true; } typedef Point2DTemplate Point2D; }; #endif