#pragma once #include #include // very shitty vec2 class #include "stdint.h" template struct gnType2 { union { struct { T a, b; }; struct { T x, y; }; }; public: gnType2(T a, T b) { this->a = a; this->b = b; } gnType2() {}; gnType2 operator-(const gnType2& other) { gnType2 returnGnVec2; returnGnVec2.x = this->x - other.x; returnGnVec2.y = this->y - other.y; return returnGnVec2; } bool operator==(const gnType2& other) const { return this->a == other.a && this->b == other.b; } }; typedef gnType2 gnVec2; typedef gnType2 gnFloat2; typedef gnType2 gnUInt2; typedef gnType2 gnInt2; namespace std { template<> struct hash { std::size_t operator()(const gnUInt2& k) const { return std::hash()(k.x) ^ (std::hash()(k.y) << 1); } }; }