diff options
author | Andy <drumsetmonkey@gmail.com> | 2017-01-20 10:37:21 -0500 |
---|---|---|
committer | Andy <drumsetmonkey@gmail.com> | 2017-01-20 10:37:21 -0500 |
commit | 4d8f9974156068e4595bf219cacfd9fcd2fd7174 (patch) | |
tree | f3e938c0e49537a9dea661f46eed6ee74950b48a /include/vector2.hpp | |
parent | 1894e311bdeb098c3bef9bd342e0eaf78d197a9b (diff) | |
parent | 1ac412a5496fb6c63c47f199dfc7facd5f4c080a (diff) |
Merge branch 'master' of https://github.com/tcsullivan/gamedev
Diffstat (limited to 'include/vector2.hpp')
-rw-r--r-- | include/vector2.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/vector2.hpp b/include/vector2.hpp index debaee9..d335a4b 100644 --- a/include/vector2.hpp +++ b/include/vector2.hpp @@ -71,10 +71,21 @@ struct vector2 { return (x == v.x) && (y == v.y); } + bool operator>(const vector2<T>& v) const { + return (x > v.x) && (y > v.y); + } + + bool operator<(const vector2<T>& v) const { + return (x < v.x) && (y < v.y); + } + // other functions std::string toString(void) const { return "(" + std::to_string(x) + ", " + std::to_string(y) + ")"; } }; +using vec2 = vector2<float>; +using dim2 = vector2<int>; + #endif // VECTOR2_HPP_ |