summaryrefslogtreecommitdiff
path: root/src/math.hpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-16 19:06:43 +0100
committerPaweł Redman <pawel.redman@gmail.com>2017-12-16 19:06:43 +0100
commit820e2e9d428c273e065cfe18b48c183a5cbedd75 (patch)
treee20a60780ecb4d7dbc53a641bdd86d3407c29577 /src/math.hpp
parentc341559390ce52b47d056226fc102287dc41b304 (diff)
Major refactor of game's entity code.
Diffstat (limited to 'src/math.hpp')
-rw-r--r--src/math.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/math.hpp b/src/math.hpp
index 5e117fd..e393015 100644
--- a/src/math.hpp
+++ b/src/math.hpp
@@ -352,6 +352,16 @@ public:
return r;
}
+ friend rect_t<T, N> operator+(const rect_t<T, N> &a, const vec_t<T, N> &b)
+ {
+ rect_t<T, N> r;
+
+ r[0] = a[0] + b;
+ r[1] = a[1] + b;
+
+ return r;
+ }
+
friend std::ostream& operator<<(std::ostream& stream, rect_t<T, N> r)
{
stream << "(" << r[0] << " x " << r[1] << ")";