1616#include " Settlement.h"
1717#include " tinyxml2.h"
1818#include " Road.h"
19-
19+ # include " GameDice.h "
2020
2121class GameVisitor ;
2222
@@ -29,20 +29,25 @@ class GameBoard {
2929
3030 std::map<Coordinate, std::unique_ptr<ResourceTile>> resources;
3131
32+ GameDice dice;
33+
34+
3235
3336 std::map<Coordinate, std::vector<std::shared_ptr<Road>>> roads;
3437
3538 std::vector<std::unique_ptr<Player>> players;
3639 Coordinate robber;
3740
41+ int currentTurn;
42+
43+ int maxVictoryPoints;
3844
3945 void addResource (int x, int y, resourceType res, int val);
4046 bool checkRolls (int * rolls);
4147
4248 bool isValidBoard () const ;
4349
4450
45- bool verifyRoadPlacement (Coordinate start, Coordinate end, Player& Owner) const ;
4651 bool outOfBounds (const Coordinate& coord) const ;
4752 bool roadExists (Coordinate start, Coordinate end) const ;
4853 bool isRoadConnectionPoint (Coordinate point, Player& Owner) const ;
@@ -68,34 +73,44 @@ class GameBoard {
6873 ~GameBoard ();
6974 GameBoard& operator =(GameBoard&) = delete ;
7075
76+ void initializeGame ();
77+
7178 void save (std::ostream& out);
7279
7380 ResourceTile& getResourceTile (Coordinate location) const ;
7481
7582 const std::map<Coordinate, std::unique_ptr<ResourceTile>>& getResources () const ;
7683
84+ void endTurn ();
85+ Player& getCurrentPlayer () const ;
7786
78-
87+ int getMaxVictoryPoints ();
88+ void setMaxVictoryPoints (int maxVicPts);
7989 const std::shared_ptr<Road> getRoad (Coordinate start, Coordinate end) const ;
8090 const std::vector<std::shared_ptr<Road>>& getRoads (Coordinate loc) const ;
8191
8292 int FindLongestRoad (const Player & owner) const ;
93+ void updateLongestRoadPlayer ();
94+ void updateLargestArmyPlayer ();
8395
8496 std::vector<Settlement*> GetNeighboringSettlements (Coordinate location) const ;
8597 std::vector<CornerPiece*> GetNeighboringCorners (Coordinate location) const ;
8698
87-
99+ int CountCornerPoints (Player& owner);
88100
89101 void PlaceSettlement (Coordinate location, Player& Owner);
90102 void UpgradeSettlement (Coordinate location);
91- // void PlaceRoad (Coordinate start, Coordinate end, Player& Owner );
103+ void UpgradeToWonder (Coordinate location );
92104
93105
106+ bool verifyRoadPlacement (Coordinate start, Coordinate end, Player& Owner) const ;
94107 bool buyRoad (Coordinate start, Coordinate end, Player& Owner);
95108
96109 // void PlaceSettlement(Coordinate location, Player& Owner);
97110 void PlaceCity (Coordinate location, Player& Owner);
111+ void PlaceWonder (Coordinate location, Player& Owner);
98112 bool PlaceRoad (Coordinate start, Coordinate end, Player& Owner);
113+ bool canPlayBuildRoadCard (Coordinate start1, Coordinate end1, Coordinate start2, Coordinate end2, Player& Owner);
99114
100115 void accept (GameVisitor& visitor);
101116
@@ -110,6 +125,7 @@ class GameBoard {
110125
111126 void moveRobber (Coordinate newRobber);
112127 Coordinate getRobber () const ;
128+ bool canRobberRob (Player& opponent, Coordinate location);
113129
114130};
115131
0 commit comments