added the less than operator to store the objects
in maps
This commit is contained in:
parent
32c7832001
commit
1231e4da92
@ -57,3 +57,8 @@ struct Board {
|
|||||||
return colour_at(xy.to_index());
|
return colour_at(xy.to_index());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline bool operator<(const Board& m1, const Board& m2) {
|
||||||
|
return m1.to_fen() < m2.to_fen(
|
||||||
|
); // TODO: make this the comparison between the hash of the board
|
||||||
|
}
|
||||||
|
@ -39,6 +39,10 @@ struct Move {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inline bool operator<(const Move& m1, const Move& m2) {
|
||||||
|
return m1.to_string() < m2.to_string();
|
||||||
|
}
|
||||||
|
|
||||||
inline std::ostream& operator<<(std::ostream& os, const Move& m) {
|
inline std::ostream& operator<<(std::ostream& os, const Move& m) {
|
||||||
os << m.to_string();
|
os << m.to_string();
|
||||||
return os;
|
return os;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user