TurboSchach/Chesspiece.h
2024-12-20 11:19:33 +01:00

47 lines
898 B
C++

//
// Created by hamac on 19.12.2024.
//
#ifndef CHESSPIECE_H
#define CHESSPIECE_H
//
// Created by hamac on 18.12.2024.
//
#include <string>
#include <vector>
#include <regex>
class Chesspiece {
private:
/* fields */
// ToDo: von char auf enum Color {W, B} umstellen
char color;
char identifier; // P,K,...
std::pair<int, int> position;
// std::vector<std::pair<int, int>>
std::vector<std::string> avaibleMoves;
/* methods */
virtual std::vector<std::string> calcAvaibleMoves() = 0;
public:
Chesspiece(char color, std::pair<int, int> position);
virtual ~Chesspiece() = default;
std::pair<int, int> getPosition();
void setPosition(std::pair<int, int> position);
char getColor();
void setColor(char color);
std::vector<std::string> getAvaibleMoves();
bool checkNotation(std::string notation);
};
#endif //CHESSPIECE_H