Refactor some code to have better naming and move Point and related point things into their own .hpp.

This commit is contained in:
Zed A. Shaw 2024-10-26 18:26:42 -04:00
parent c19cd707d1
commit 5a123ae74c
7 changed files with 45 additions and 40 deletions

18
point.hpp Normal file
View file

@ -0,0 +1,18 @@
#pragma once
struct Point {
size_t x = 0;
size_t y = 0;
bool operator==(const Point& other) const {
return other.x == x && other.y == y;
}
};
typedef std::vector<Point> PointList;
struct PointHash {
size_t operator()(const Point& p) const {
return std::hash<int>()(p.x) ^ std::hash<int>()(p.y);
}
};