Skip to content

Commit 5384a81

Browse files
committed
Added getter for pieces
1 parent b3d6e9b commit 5384a81

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

include/GameBoard.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class GameBoard {
1818
GameBoard(GameBoard&) = delete;
1919
~GameBoard();
2020
GameBoard& operator=(GameBoard&) = delete;
21+
22+
const std::map<Coordinate, std::unique_ptr<GamePiece>>& getPieces() const;
2123
};
2224

2325
#endif

src/GameBoard.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
#include "GameBoard.h"
22

3+
#include <map>
4+
#include <memory>
5+
6+
using std::map;
7+
using std::unique_ptr;
8+
39
GameBoard::GameBoard() {
410

511
}
612

713
GameBoard::~GameBoard() {
814

9-
}
15+
}
16+
17+
const map<Coordinate, unique_ptr<GamePiece>>& GameBoard::getPieces() const {
18+
return pieces;
19+
}

0 commit comments

Comments
 (0)