TurboSchach/Chesspiece.h

47 lines
898 B
C
Raw Permalink Normal View History

//
// 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,...
std::pair<int, int> position;
2024-12-20 10:19:33 +00:00
// std::vector<std::pair<int, int>>
std::vector<std::string> avaibleMoves;
/* 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);
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();
bool checkNotation(std::string notation);
};
#endif //CHESSPIECE_H