-
Notifications
You must be signed in to change notification settings - Fork 0
/
NewGame.cpp
53 lines (43 loc) · 1.22 KB
/
NewGame.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "NewGame.h"
#include "Grid.h"
#include "Player.h"
NewGame::NewGame(ApplicationManager *pApp):Action(pApp)
{
}
void NewGame::ReadActionParameters()
{
// no parameters to read from user
}
void NewGame::Execute()
{
CellPosition Restart(NumVerticalCells - 1, 0);
Grid *P = pManager->GetGrid();
Output *pOut = P->GetOutput();
Input *pIn = P->GetInput();
pOut->PrintMessage("You Will begin a New Game | Click to Continue..");
int x, y;
pIn->GetPointClicked(x, y);
pOut->ClearStatusBar();
//Here We want to make current player zero then got to for loop with current player0
P->GetCurrentPlayer();
while (P->GetCurrentPlayer()->getPlayerNum())
{
P->AdvanceCurrentPlayer();
}
for(int i = 0; i < MaxPlayerCount; i++)//Because there are 4 Players in the game
{
P->UpdatePlayerCell(P->GetCurrentPlayer(), Restart);
//PP = P->GetCurrentPlayer();
P->GetCurrentPlayer()->SetWallet(100);
P->GetCurrentPlayer()->SetTurnCount(0);
for(int i = 7; i <= 11; ++i)
P->SetCityOwner(NULL, i);
//in completing Setters in player for turncount and sterpcount PP->Set...(0);
P->AdvanceCurrentPlayer();
}
//Players of course don't End Game IT's just A check
P->SetEndGame(false);
}
NewGame::~NewGame(void)
{
}