123456789101112131415161718192021222324 |
- #include "Pawn.h"
- #include "Position.h"
- #include <utility>
- #include <stdexcept>
- #include <iostream>
- Pawn::Pawn(Position pos) {
- position = pos;
- }
- std::pair<int, Position*> 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<int, Position*>(1, moves);
- };
|