1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:07:46 +00:00

LibChess: Make piece_for_char_promotion() more generally useful

- Rename to make it clear it's not just for promotion
- Understand 'p' for pawns
- Take a char parameter instead of StringView since it's always 1 char
This commit is contained in:
Sam Atkins 2023-04-24 12:12:14 +01:00 committed by Andreas Kling
parent b111782f18
commit c73c697f94
2 changed files with 16 additions and 14 deletions

View file

@ -30,7 +30,7 @@ enum class Notation {
FEN,
};
Optional<char> char_for_piece(Type, Notation);
Chess::Type piece_for_char_promotion(StringView str);
Type piece_from_char(char);
enum class Color : u8 {
White,