#include "Pawn.h" #include "Position.h" #include #include #include Pawn::Pawn(Position pos, char c) { if (c != 'B' and c != 'W') throw std::invalid_argument("Impossible color of figure!"); position = pos; color = c; } std::pair Pawn::get_moves() { Position* moves = new Position[1]; Position p; try { p = Position(position.posSym, (char)(position.posNum+1)); } catch (const std::invalid_argument) { p = Position(); } moves[0] = p; return std::pair(1, moves); } const char* Pawn::print() { const char* me; if (color == 'B') me = "♟"; else me = "♙"; return me; }