#ifndef MGLPP_FLOAT_RECT_HPP #define MGLPP_FLOAT_RECT_HPP #include "../system/vec.hpp" namespace mgl { template class Rect { public: Rect() : position(0, 0), size(0, 0) {} Rect(vec2 position, vec2 size) : position(position), size(size) {} bool contains(vec2 point) const { return point.x >= position.x && point.x <= position.x + size.x && point.y >= position.y && point.y <= position.y + size.y; } vec2 position; vec2 size; }; typedef Rect IntRect; typedef Rect FloatRect; } #endif /* MGLPP_FLOAT_RECT_HPP */