Start implementation of Pawn class
This commit is contained in:
parent
1a931462e2
commit
94a86ede09
33
Pawn.cpp
33
Pawn.cpp
@ -1,3 +1,36 @@
|
|||||||
//
|
//
|
||||||
// Created by hamac on 19.12.2024.
|
// Created by hamac on 19.12.2024.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
#include <iostream>
|
||||||
|
#include "Chesspiece.cpp"
|
||||||
|
|
||||||
|
class Pawn: public Chesspiece {
|
||||||
|
private:
|
||||||
|
/* fields */
|
||||||
|
bool firstMove = true;
|
||||||
|
bool movedTwoFields = false;
|
||||||
|
|
||||||
|
|
||||||
|
/* methods */
|
||||||
|
std::vector<std::string> calcAvaibleMoves() override {
|
||||||
|
std::pair<int, int> pos = getPosition();
|
||||||
|
std::vector<std::string> moves;
|
||||||
|
|
||||||
|
if (firstMove) {
|
||||||
|
|
||||||
|
//moves.
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
std::cout << "Hello World!\n" << std::endl;
|
||||||
|
return moves;
|
||||||
|
}
|
||||||
|
public:
|
||||||
|
Pawn(char color, std::pair<int, int> position) : Chesspiece() {
|
||||||
|
setPosition(position);
|
||||||
|
setColor(color);
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user