@@ -86,9 +86,10 @@ bool ViewElement::handleClick(ScreenCoordinate coord) {
8686 * Constrct a GameView.
8787 * @param model The GameBoard the view is displaying.
8888 */
89- GameView::GameView (GameBoard& model) : model(model) {
89+ GameView::GameView (GameBoard& model) : model(model)
90+ {
9091 controlStateText = " Welcome to Wars of Catan" ;
91-
92+ showTotals = false ;
9293}
9394
9495/* *
@@ -104,7 +105,19 @@ GameView::~GameView() {
104105 * @param font the style of font to use, fontSize the resolution of the font used
105106 * @return void
106107 */
107- void GameView::drawCardCount (std::string font, int fontSize){
108+ void GameView::drawCardCount (std::string font, int fontSize)
109+ {
110+ if (showTotals==false )
111+ {
112+ renderText (font, fontSize, {0.97 , 0.0 }, {1.0 , 0.05 }, " ?" ); // Road Building
113+ renderText (font, fontSize, {0.97 , 0.05 }, {1.0 , 0.1 }, " ?" ); // Knight
114+ renderText (font, fontSize, {0.97 , 0.1 }, {1.0 , 0.15 }, " ?" ); // Year of Plenty
115+ renderText (font, fontSize, {0.97 , 0.15 }, {1.0 , 0.2 }, " ?" ); // Monopoly
116+ renderText (font, fontSize, {0.97 , 0.2 }, {1.0 , 0.25 }, " ?" ); // Victory Point
117+ return ;
118+ }
119+
120+
108121 renderText (font, fontSize, {0.97 , 0.0 }, {1.0 , 0.05 },
109122 toString (model.getCurrentPlayer ().getRoadBuildingCards ())); // Road Building
110123 renderText (font, fontSize, {0.97 , 0.05 }, {1.0 , 0.1 },
@@ -120,16 +133,27 @@ void GameView::drawCardCount(std::string font, int fontSize){
120133/* *
121134 * Draws the count of resources the currentPlayer has
122135 */
123- void GameView::drawResourceCount (std::string font, int fontSize){
124- renderText (font, fontSize, {0.97 , 0.35 }, {1.0 , 0.40 },
136+ void GameView::drawResourceCount (std::string font, int fontSize)
137+ {
138+ if (showTotals==false )
139+ {
140+ renderText (font, fontSize, {0.97 , 0.30 }, {1.0 , 0.35 }, " ?" ); // Wood
141+ renderText (font, fontSize, {0.97 , 0.35 }, {1.0 , 0.40 }, " ?" ); // Sheep
142+ renderText (font, fontSize, {0.97 , 0.40 }, {1.0 , 0.45 }, " ?" ); // Ore
143+ renderText (font, fontSize, {0.97 , 0.45 }, {1.0 , 0.50 }, " ?" ); // Brick
144+ renderText (font, fontSize, {0.97 , 0.50 }, {1.0 , 0.55 }, " ?" ); // Wheat
145+ return ;
146+ }
147+
148+ renderText (font, fontSize, {0.97 , 0.30 }, {1.0 , 0.35 },
125149 toString (model.getCurrentPlayer ().getWood ())); // Wood
126- renderText (font, fontSize, {0.97 , 0.40 }, {1.0 , 0.45 },
150+ renderText (font, fontSize, {0.97 , 0.35 }, {1.0 , 0.40 },
127151 toString (model.getCurrentPlayer ().getWool ())); // Sheep
128- renderText (font, fontSize, {0.97 , 0.45 }, {1.0 , 0.50 },
152+ renderText (font, fontSize, {0.97 , 0.40 }, {1.0 , 0.45 },
129153 toString (model.getCurrentPlayer ().getOre ())); // Ore
130- renderText (font, fontSize, {0.97 , 0.50 }, {1.0 , 0.55 },
154+ renderText (font, fontSize, {0.97 , 0.45 }, {1.0 , 0.50 },
131155 toString (model.getCurrentPlayer ().getBrick ())); // Brick
132- renderText (font, fontSize, {0.97 , 0.55 }, {1.0 , 0.60 },
156+ renderText (font, fontSize, {0.97 , 0.50 }, {1.0 , 0.55 },
133157 toString (model.getCurrentPlayer ().getWheat ())); // Wheat
134158
135159}
0 commit comments