Skip to content

Commit 342e99b

Browse files
committed
Merge pull request #56 from Databean/robber_finishing
Robber finishing
2 parents cb45f80 + 67630f0 commit 342e99b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/GameBoard.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,15 @@ GameBoard::GameBoard(const vector<std::string>& playerNames) {
6565
}
6666
valid = isValidBoard();
6767
}
68-
moveRobber(Coordinate(0,4));
68+
//moveRobber(Coordinate(0,4));
69+
auto it = getResources().begin();
70+
while(it != getResources().end()) {
71+
if ((it->second)->getType() == DESERT)
72+
moveRobber(it->first);
73+
it++;
74+
}
75+
std::cout << getRobber().first << "\n";
76+
std::cout << getRobber().second << "\n";
6977

7078
}
7179

src/GameView.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,6 @@ void DrawingGameVisitor::visit(GameDice& dice) {
574574

575575
static const GLuint diceTextures = loadImageAsTexture("resources/catan_dice_new.bmp");
576576

577-
578577
glBindTexture(GL_TEXTURE_2D, diceTextures);
579578

580579
glColor3d(1.0, 1.0, 1.0);
@@ -657,7 +656,8 @@ void DrawingGameVisitor::visit(ResourceTile& tile) {
657656
vertexPair(Coordinate(coord.first + adjacentCoordDiffs[0].first, coord.second + adjacentCoordDiffs[0].second));
658657
glEnd();
659658

660-
if(tile.getDiceValue() != 0) {
659+
if(tile.getDiceValue() != 0 ||
660+
tile.getBoard().getResourceTile(tile.getBoard().getRobber()).getType() == DESERT) {
661661
if (tile.getBoard().getRobber() == coord) { //draw the robber on this tile
662662

663663
drawTexturedCircle(make_pair(1240.f, 643.f), 59.5f, coordToScreen(coord), 0.04);

0 commit comments

Comments
 (0)