@@ -61,24 +61,66 @@ GameController::GameController(GameBoard& model, GameView& view) : model(model),
6161 getGraphicsConfig ()[" screen.bankButton.area" ],
6262 font, fontSize, getGraphicsConfig ()[" screen.bankButton.text" ]));
6363
64- view.addElement (makeViewButtonText (std::bind (&GameController::handleCancelButtonEvent, this , _1), {{.92 , .96 }, {1.0 , 1.0 }}, font, fontSize, " Cancel" ));
64+ view.addElement (makeViewButtonText (
65+ std::bind (&GameController::handleCancelButtonEvent, this , _1),
66+ getGraphicsConfig ()[" screen.cancelButton.area" ],
67+ font, fontSize, getGraphicsConfig ()[" screen.cancelButton.text" ]));
6568
66- view.addElement (makeViewButtonText (std::bind (&GameController::handleBuyDevelopmentCardButtonEvent, this , _1), {{.85 , .23 }, {1 , .30 }}, font, fontSize, " Development Cards" ));
67- view.addElement (makeViewButtonText (std::bind (&GameController::handleRoadCardButtonEvent, this , _1), {{0.85 , 0.0 }, {0.97 , 0.05 }}, font, fontSize, " Road Building " ));
68- view.addElement (makeViewButtonText (std::bind (&GameController::handleKnightCardButtonEvent, this , _1), {{0.85 , 0.05 }, {0.97 , 0.10 }}, font, fontSize, " Knight " ));
69- view.addElement (makeViewButtonText (std::bind (&GameController::handleYearOfPlentyCardButtonEvent, this , _1), {{0.85 , 0.10 }, {0.97 , 0.15 }}, font, fontSize, " Year of Plenty " ));
70- view.addElement (makeViewButtonText (std::bind (&GameController::handleMonopolyCardButtonEvent, this , _1), {{0.85 , 0.15 }, {0.97 , 0.20 }}, font, fontSize, " Monopoly " ));
71- view.addElement (makeViewButtonText (std::bind (&GameController::handleVictoryPointCardButtonEvent, this , _1), {{0.85 , 0.20 }, {0.97 , 0.25 }}, font, fontSize, " Victory Point " ));
69+ view.addElement (makeViewButtonText (
70+ std::bind (&GameController::handleBuyDevelopmentCardButtonEvent, this , _1),
71+ getGraphicsConfig ()[" screen.developmentCardButton.area" ],
72+ font, fontSize, getGraphicsConfig ()[" screen.developmentCardButton.text" ]));
73+ view.addElement (makeViewButtonText (
74+ std::bind (&GameController::handleRoadCardButtonEvent, this , _1),
75+ getGraphicsConfig ()[" screen.roadBuildingButton.area" ],
76+ font, fontSize, getGraphicsConfig ()[" screen.roadBuildingButton.text" ]));
77+ view.addElement (makeViewButtonText (
78+ std::bind (&GameController::handleKnightCardButtonEvent, this , _1),
79+ getGraphicsConfig ()[" screen.knightButton.area" ],
80+ font, fontSize, getGraphicsConfig ()[" screen.knightButton.text" ]));
81+ view.addElement (makeViewButtonText (
82+ std::bind (&GameController::handleYearOfPlentyCardButtonEvent, this , _1),
83+ getGraphicsConfig ()[" screen.yearOfPlentyButton.area" ],
84+ font, fontSize, getGraphicsConfig ()[" screen.yearOfPlentyButton.text" ]));
85+ view.addElement (makeViewButtonText (
86+ std::bind (&GameController::handleMonopolyCardButtonEvent, this , _1),
87+ getGraphicsConfig ()[" screen.monopolyButton.area" ],
88+ font, fontSize, getGraphicsConfig ()[" screen.monopolyButton.text" ]));
89+ view.addElement (makeViewButtonText (
90+ std::bind (&GameController::handleVictoryPointCardButtonEvent, this , _1),
91+ getGraphicsConfig ()[" screen.victoryPointButton.area" ],
92+ font, fontSize, getGraphicsConfig ()[" screen.victoryPointButton.text" ]));
93+
94+ view.addElement (makeViewButtonText (
95+ std::bind (&GameController::handleWoodButtonEvent, this , _1),
96+ getGraphicsConfig ()[" screen.woodButton.area" ],
97+ font, fontSize, getGraphicsConfig ()[" screen.woodButton.text" ]));
98+ view.addElement (makeViewButtonText (
99+ std::bind (&GameController::handleSheepButtonEvent, this , _1),
100+ getGraphicsConfig ()[" screen.sheepButton.area" ],
101+ font, fontSize, getGraphicsConfig ()[" screen.sheepButton.text" ]));
102+ view.addElement (makeViewButtonText (
103+ std::bind (&GameController::handleOreButtonEvent, this , _1),
104+ getGraphicsConfig ()[" screen.oreButton.area" ],
105+ font, fontSize, getGraphicsConfig ()[" screen.oreButton.text" ]));
106+ view.addElement (makeViewButtonText (
107+ std::bind (&GameController::handleBrickButtonEvent, this , _1),
108+ getGraphicsConfig ()[" screen.brickButton.area" ],
109+ font, fontSize, getGraphicsConfig ()[" screen.brickButton.text" ]));
110+ view.addElement (makeViewButtonText (
111+ std::bind (&GameController::handleWheatButtonEvent, this , _1),
112+ getGraphicsConfig ()[" screen.wheatButton.area" ],
113+ font, fontSize, getGraphicsConfig ()[" screen.wheatButton.text" ]));
114+
115+ view.addElement (makeViewButtonText (
116+ std::bind (&GameController::viewCardTotals, this , _1),
117+ getGraphicsConfig ()[" screen.showTotalButton.area" ],
118+ font, fontSize, getGraphicsConfig ()[" screen.showTotalButton.text" ]));
119+
120+ view.addElement (100 , makeViewButton (
121+ std::bind (&GameController::handleBoardEvent, this , _1),
122+ getGraphicsConfig ()[" screen.board.area" ]));
72123
73- view.addElement (makeViewButtonText (std::bind (&GameController::handleWoodButtonEvent, this , _1), {{.85 , .30 }, {.97 , .35 }}, font, fontSize, " Wood " ));
74- view.addElement (makeViewButtonText (std::bind (&GameController::handleSheepButtonEvent, this , _1), {{.85 , .35 }, {.97 , .40 }}, font, fontSize, " Sheep " ));
75- view.addElement (makeViewButtonText (std::bind (&GameController::handleOreButtonEvent, this , _1), {{.85 , .40 }, {.97 , .45 }}, font, fontSize, " Ore " ));
76- view.addElement (makeViewButtonText (std::bind (&GameController::handleBrickButtonEvent, this , _1), {{.85 , .45 }, {.97 , .50 }}, font, fontSize, " Brick " ));
77- view.addElement (makeViewButtonText (std::bind (&GameController::handleWheatButtonEvent, this , _1), {{.85 , .50 }, {.97 , .55 }}, font, fontSize, " Wheat " ));
78-
79- view.addElement (makeViewButtonText (std::bind (&GameController::viewCardTotals, this , _1), {{.85 , .55 }, {.97 , .60 }}, font, fontSize, " Show Totals" ));
80-
81- view.addElement (100 , makeViewButton (std::bind (&GameController::handleBoardEvent, this , _1), {{0 , 0 }, {1 , 1 }}));
82124 stateStack.push_back (BASESTATE);
83125}
84126
@@ -165,17 +207,6 @@ int GameController::getClickHistorySize(){
165207 return clickHistory.size ();
166208}
167209
168- /* *
169- * Now that the GUI has this information implemented, I am returning before this function prints. To use this function again simply remove the return
170- */
171- void printPlayerInfo (const Player& player)
172- {
173- return ;
174- auto color = player.getColor ();
175- std::cout << player.getName () << " 's turn. (" << std::get<0 >(color) << " , " << std::get<1 >(color) << " , " << std::get<2 >(color) <<" )" << std::endl;
176- std::cout << " Wood: " << player.getWood () << " , Brick: " << player.getBrick () << " , Ore: " << player.getOre () << " , Wheat: " << player.getWheat () << " , Wool: " << player.getWool () << std::endl;
177- }
178-
179210/* *
180211 * calls a function to advance turn, hide resource and development cards, check for victory, and roll dice
181212 */
@@ -192,8 +223,6 @@ bool GameController::nextTurn(ScreenCoordinate) {
192223 view.setControlStateText (" The Robber is out! Click a tile to place it!" );
193224 pushState (ROBBER);
194225 }
195-
196- printPlayerInfo (model.getCurrentPlayer ());
197226 return true ;
198227}
199228
@@ -205,7 +234,6 @@ bool GameController::nextTurn(ScreenCoordinate) {
205234 * @return Whether this event was handled by this element. Always true.
206235 */
207236bool GameController::handleBoardEvent (ScreenCoordinate screenCoord) {
208- printPlayerInfo (model.getCurrentPlayer ());
209237 auto coord = screenToCoord (screenCoord);
210238 std::vector<Settlement*> neighbors;
211239
0 commit comments