LibChess: Shrink Chess::Piece from 8 bytes to 1 byte
This makes the engine footprint a lot smaller.
This commit is contained in:
parent
1e57e32a93
commit
23813d9bc9
Notes:
sideshowbarker
2024-07-19 03:21:58 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/23813d9bc9e
1 changed files with 12 additions and 2 deletions
|
@ -57,8 +57,18 @@ enum class Colour {
|
|||
Colour opposing_colour(Colour colour);
|
||||
|
||||
struct Piece {
|
||||
Colour colour;
|
||||
Type type;
|
||||
constexpr Piece()
|
||||
: colour(Colour::None)
|
||||
, type(Type::None)
|
||||
{
|
||||
}
|
||||
constexpr Piece(Colour c, Type t)
|
||||
: colour(c)
|
||||
, type(t)
|
||||
{
|
||||
}
|
||||
Colour colour : 4;
|
||||
Type type : 4;
|
||||
bool operator==(const Piece& other) const { return colour == other.colour && type == other.type; }
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue