-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNewGameAction.cpp
More file actions
43 lines (31 loc) · 966 Bytes
/
Copy pathNewGameAction.cpp
File metadata and controls
43 lines (31 loc) · 966 Bytes
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
#include "NewGameAction.h"
NewGameAction::NewGameAction(ApplicationManager* pApp) : Action(pApp)
{
pGrid = pManager->GetGrid();
pOut = pGrid->GetOutput();
currentPlayer = pGrid->GetCurrentPlayer();
}
void NewGameAction:: ReadActionParameters()
{
};
void NewGameAction::Execute()
{
// Get the grid from the ApplicationManager
Grid* pGrid = pManager->GetGrid();
// Iterate through all cells and remove objects
// for (int i = 0; i < NumVerticalCells; i++)
// {
// for (int j = 0; j < NumHorizontalCells; j++)
// {
// CellPosition pos(i, j); // Create a CellPosition for each cell
// pGrid->RemoveObjectFromCell(pos); // Clear the object from the cell
// }
// }
// Provide feedback
Output* pOut = pGrid->GetOutput();
pOut->ClearGridArea();
pOut->PrintMessage("New game started. All objects have been cleared!");
}
NewGameAction::~NewGameAction()
{
}