Skip to content

Commit 44b1f33

Browse files
committed
Merge pull request #75 from Databean/minor_controller_refactor
Changed the name of a couple button handlers to be more descriptive
2 parents 5530204 + aa8b6d3 commit 44b1f33

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/GameController.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class GameController {
3434
GameController(GameBoard&, GameView& view);
3535
~GameController();
3636

37-
bool nextTurn(ScreenCoordinate);
37+
bool handleNextTurnButtonEvent(ScreenCoordinate);
3838
bool handleBoardEvent(ScreenCoordinate);
3939
bool handleRoadButtonEvent(ScreenCoordinate);
4040
bool handleSettlementButtonEvent(ScreenCoordinate);
@@ -59,7 +59,7 @@ class GameController {
5959
bool handleConfirmRoadCard(ScreenCoordinate);
6060
bool handleCancelDialogueEvent(ScreenCoordinate);
6161

62-
bool viewCardTotals(ScreenCoordinate coord);
62+
bool handleViewCardTotalsButtonEvent(ScreenCoordinate coord);
6363

6464
void pushState(ControlState);
6565
ControlState getState();

src/GameController.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ GameController::GameController(GameBoard& model, GameView& view) : model(model),
4141
font, fontSize, getGraphicsConfig()["screen.wonderButton.text"]));
4242

4343
view.addElement(makeViewButtonText(
44-
std::bind(&GameController::nextTurn, this, _1),
44+
std::bind(&GameController::handleNextTurnButtonEvent, this, _1),
4545
getGraphicsConfig()["screen.endTurnButton.area"],
4646
font, fontSize, "End Turn"));
4747

@@ -112,7 +112,7 @@ GameController::GameController(GameBoard& model, GameView& view) : model(model),
112112
font, fontSize, getGraphicsConfig()["screen.wheatButton.text"]));
113113

114114
view.addElement(makeViewButtonText(
115-
std::bind(&GameController::viewCardTotals, this, _1),
115+
std::bind(&GameController::handleViewCardTotalsButtonEvent, this, _1),
116116
getGraphicsConfig()["screen.showTotalButton.area"],
117117
font, fontSize, getGraphicsConfig()["screen.showTotalButton.text"]));
118118

@@ -207,7 +207,7 @@ int GameController::getClickHistorySize(){
207207
/**
208208
* calls a function to advance turn, hide resource and development cards, check for victory, and roll dice
209209
*/
210-
bool GameController::nextTurn(ScreenCoordinate) {
210+
bool GameController::handleNextTurnButtonEvent(ScreenCoordinate) {
211211
if(getState() != BASESTATE){
212212
return false;
213213
}
@@ -492,7 +492,7 @@ bool GameController::handleVictoryPointCardButtonEvent(ScreenCoordinate coord){
492492
/**
493493
* Makes the development and resource card totals visible
494494
*/
495-
bool GameController::viewCardTotals(ScreenCoordinate coord)
495+
bool GameController::handleViewCardTotalsButtonEvent(ScreenCoordinate coord)
496496
{
497497
auto font = getGraphicsConfig()["font.path"];
498498
auto fontSize = getGraphicsConfig()["font.size"];

0 commit comments

Comments
 (0)