-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUseConsumablesAction.cpp
More file actions
59 lines (38 loc) · 1.13 KB
/
Copy pathUseConsumablesAction.cpp
File metadata and controls
59 lines (38 loc) · 1.13 KB
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
54
55
56
57
58
59
#include "UseConsumablesAction.h"
UseConsumablesAction::UseConsumablesAction(ApplicationManager* pApp) : Action(pApp)
{
}
void UseConsumablesAction::ReadActionParameters()
{
}
void UseConsumablesAction::Execute()
{
ToolKit* toolkit = pManager->GetGrid()->GetToolkit();
Output * pOut = pManager->GetGrid()->GetOutput();
Player* currentPlayer = pManager->GetGrid()->GetCurrentPlayer();
Execute:
pOut->PrintMessage("Select the desired consumable: 0- ToolKit 1- Hack Device");
int choice = pManager->GetGrid()->GetInput()->GetInteger(pOut);
if (choice == 0) ///////ToolKit option
{
if (!(currentPlayer->GetHasToolkit()))
{
pOut->PrintMessage("You dont have a ToolKit !!");
return;
}
toolkit->use();
pOut->PrintMessage("---Successfully used the ToolKit---");
}
else if (choice == 1) /////// hack device option
{
/* code */
}
else
{
pManager->GetGrid()->PrintErrorMessage("Invalid Selection !! Click anywhere to reselect");
goto Execute;
}
}
UseConsumablesAction::~UseConsumablesAction()
{
}