-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCardTwo.cpp
More file actions
30 lines (25 loc) · 696 Bytes
/
CardTwo.cpp
File metadata and controls
30 lines (25 loc) · 696 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
#include "CardTwo.h"
CardTwo::CardTwo(const CellPosition& cellposition) : Card(cellposition) {
cardNumber = 2;
}
void CardTwo::Apply(Grid* pGrid,Player* pPlayer) {
Output* pOut = pGrid->GetOutput();
Ladder* P = pGrid->GetNextLadder(pPlayer->GetCell()->GetCellPosition());
pGrid->PrintErrorMessage("You've reached card 2 ! moving to the next ladder, click anywhere to continue...");
if (P)
{
pGrid->UpdatePlayerCell(pPlayer, P->GetPosition());
}
else pOut->PrintMessage("No ladders ahead....");
}
void CardTwo::Save(ofstream& OutFile, int Type)
{
if (Type == 2) {
Card::Save(OutFile, Type);
OutFile << endl;
}
}
void CardTwo::Load(ifstream& Infile)
{
Card::Load(Infile);
}