46 lines
828 B
C
46 lines
828 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;
|
||
|
std::pair<int, int> position;
|
||
|
std::vector<std::string> positions;
|
||
|
|
||
|
/* methods */
|
||
|
virtual std::vector<std::string> calcAvaibleMoves() = 0;
|
||
|
|
||
|
public:
|
||
|
Chesspiece(char color, char identifier);
|
||
|
|
||
|
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> getPositions();
|
||
|
|
||
|
bool checkNotation(std::string notation);
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif //CHESSPIECE_H
|