2024-12-20 01:06:12 +00:00
|
|
|
//
|
|
|
|
// 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;
|
2024-12-20 10:19:33 +00:00
|
|
|
char identifier; // P,K,...
|
2024-12-20 01:06:12 +00:00
|
|
|
std::pair<int, int> position;
|
2024-12-20 10:19:33 +00:00
|
|
|
// std::vector<std::pair<int, int>>
|
|
|
|
std::vector<std::string> avaibleMoves;
|
2024-12-20 01:06:12 +00:00
|
|
|
|
|
|
|
/* methods */
|
|
|
|
virtual std::vector<std::string> calcAvaibleMoves() = 0;
|
|
|
|
|
|
|
|
public:
|
2024-12-20 10:19:33 +00:00
|
|
|
Chesspiece(char color, std::pair<int, int> position);
|
2024-12-20 01:06:12 +00:00
|
|
|
|
|
|
|
virtual ~Chesspiece() = default;
|
|
|
|
|
|
|
|
std::pair<int, int> getPosition();
|
|
|
|
void setPosition(std::pair<int, int> position);
|
|
|
|
|
|
|
|
char getColor();
|
|
|
|
void setColor(char color);
|
|
|
|
|
2024-12-20 10:19:33 +00:00
|
|
|
std::vector<std::string> getAvaibleMoves();
|
2024-12-20 01:06:12 +00:00
|
|
|
|
|
|
|
bool checkNotation(std::string notation);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //CHESSPIECE_H
|