mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:34:59 +00:00
LibChess: Add convenience constructor for Chess::Square
It didn't feel right to add sv suffixes to 2-character strings, so I added this convenience constructor.
This commit is contained in:
parent
7456904a39
commit
6c46383e23
1 changed files with 7 additions and 0 deletions
|
@ -57,7 +57,14 @@ constexpr Piece EmptyPiece = { Color::None, Type::None };
|
|||
struct Square {
|
||||
i8 rank; // zero indexed;
|
||||
i8 file;
|
||||
|
||||
Square(StringView name);
|
||||
|
||||
Square(char const name[3])
|
||||
: Square({ name, 2 })
|
||||
{
|
||||
}
|
||||
|
||||
Square(int const& rank, int const& file)
|
||||
: rank(rank)
|
||||
, file(file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue