aboutsummaryrefslogtreecommitdiffstats
path: root/include/vector2.hpp
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2017-04-27 21:33:13 -0400
committerdrumsetmonkey <abelleisle@roadrunner.com>2017-04-27 21:33:13 -0400
commit2de1af94cfa794ae5dd7913c797d673b58289949 (patch)
tree3acb4e822943efb714ff04d4e88307127e34f52e /include/vector2.hpp
parent40f2ab396ccca1a12cc74d18c9758da5bc2f1afc (diff)
parent00de7a4b0aa48c3cb42c45e0f203902ca034b94c (diff)
Updated sprites
Diffstat (limited to 'include/vector2.hpp')
-rw-r--r--include/vector2.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/vector2.hpp b/include/vector2.hpp
index beb2787..77ee7e7 100644
--- a/include/vector2.hpp
+++ b/include/vector2.hpp
@@ -35,10 +35,20 @@ struct vector2 {
return vector2<T>(x + v.x, y + v.y);
}
+ template<typename T2>
+ vector2<T> operator+(const vector2<T2>& v) const {
+ return vector2<T>(x + v.x, y + v.y);
+ }
+
vector2<T> operator+(const T& n) const {
return vector2<T>(x + n, y + n);
}
+ vector2<T> operator+=(const vector2<T>& v) {
+ x += v.x, y += v.y;
+ return *this;
+ }
+
// subtraction
vector2<T> operator-(const vector2<T>& v) const {
return vector2<T>(x - v.x, y - v.y);