Refactor some code to have better naming and move Point and related point things into their own .hpp.
This commit is contained in:
parent
c19cd707d1
commit
5a123ae74c
7 changed files with 45 additions and 40 deletions
18
point.hpp
Normal file
18
point.hpp
Normal 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);
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue