Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Key // koordynaty hexa
- {
- int x, y, z;
- Key(int x, int y, int z) : x(x), y(y), z(z) {}
- bool operator==(const Key &other) const
- {
- return (x == other.x && y == other.y && z == other.z);
- }
- };
- struct KeyHasher
- {
- const int c = 1000; // wartosc wieksza niz bok mapy i c^3 < max unsigned long size
- std::size_t operator()(const Key& k) const
- {
- return static_cast<std::size_t>(x + (y*c) + (z*c*c));
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement