#pragma once #include #include "core/point.h" #include "core/vector.h" namespace kku { /// Area /// /// Consists of 2 arithmetic /// points that represent /// a rectangle position /// and 2 arithmetic /// lengths by x and y /// that represent /// rectangle coverage area template >> struct Area { T left = 0; T top = 0; T width = 0; T height = 0; inline kku::Point position() const noexcept { return kku::Point{static_cast(left), static_cast(top) }; } inline void moveBy(const kku::Vector2& vector) { top += vector.second; left += vector.first; } inline bool contains(const kku::Point& point) const { return point.x >= left ; // debug it when on computer } }; }