From 94a86ede098740a256b489a5731f38be382723ed Mon Sep 17 00:00:00 2001 From: Fabian Hamacher Date: Thu, 19 Dec 2024 14:23:57 +0100 Subject: [PATCH] Start implementation of Pawn class --- Pawn.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Pawn.cpp b/Pawn.cpp index ba558b2..917ac9e 100644 --- a/Pawn.cpp +++ b/Pawn.cpp @@ -1,3 +1,36 @@ // // Created by hamac on 19.12.2024. // + +#include +#include +#include +#include "Chesspiece.cpp" + +class Pawn: public Chesspiece { + private: + /* fields */ + bool firstMove = true; + bool movedTwoFields = false; + + + /* methods */ + std::vector calcAvaibleMoves() override { + std::pair pos = getPosition(); + std::vector moves; + + if (firstMove) { + + //moves. + } + + + std::cout << "Hello World!\n" << std::endl; + return moves; + } + public: + Pawn(char color, std::pair position) : Chesspiece() { + setPosition(position); + setColor(color); + } +}; \ No newline at end of file