summaryrefslogtreecommitdiff
path: root/engine/include
diff options
context:
space:
mode:
Diffstat (limited to 'engine/include')
-rw-r--r--engine/include/kurator/engine/Point.h1
-rw-r--r--engine/include/kurator/engine/Rect.h27
2 files changed, 28 insertions, 0 deletions
diff --git a/engine/include/kurator/engine/Point.h b/engine/include/kurator/engine/Point.h
index 4b352d6..eecf2c6 100644
--- a/engine/include/kurator/engine/Point.h
+++ b/engine/include/kurator/engine/Point.h
@@ -23,6 +23,7 @@ struct Point
Point subtract(double _x, double _y) const;
bool operator==(const Point& other) const;
bool operator!=(const Point& other) const;
+ friend Point abs(const Point& point);
};
diff --git a/engine/include/kurator/engine/Rect.h b/engine/include/kurator/engine/Rect.h
new file mode 100644
index 0000000..d485937
--- /dev/null
+++ b/engine/include/kurator/engine/Rect.h
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "Point.h"
+
+
+namespace kurator
+{
+namespace engine
+{
+
+
+struct Rect
+{
+ Rect();
+ Rect(const Point& first, const Point& second);
+ Point position;
+ Point size;
+ Point topleft() const;
+ Point bottomright() const;
+ Point center() const;
+ bool contains(const Point& point);
+ bool contains(const Point& circle, double radius);
+};
+
+
+} // namespace engine
+} // namespace kurator