// // Created by hamac on 18.12.2024. // #include "Chesspiece.h" Chesspiece::Chesspiece(char color, std::pair position) : color(color), position(position) {} std::pair Chesspiece::getPosition() { return this->position; }; void Chesspiece::setPosition(std::pair position) { this->position = position; Chesspiece::calcAvaibleMoves(); // Brett -> Auswahl Figuren -> Züge gewählte } char Chesspiece::getColor() { return color; } void Chesspiece::setColor(char color) { color = color; } std::vector Chesspiece::getAvaibleMoves() { return avaibleMoves; } bool Chesspiece::checkNotation(std::string notation) { std::regex pattern("R^([KQRNBP]?)([a-h][1-8])[-x]([a-h][1-8])([+#]?)$"); std::smatch match; return (std::regex_search(notation, match, pattern) ? true : false); }