-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCard6.cpp
More file actions
28 lines (22 loc) · 853 Bytes
/
Copy pathCard6.cpp
File metadata and controls
28 lines (22 loc) · 853 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
#include "Card6.h"
Card6::Card6(const CellPosition& pos) : Card(pos) // set the cell position of the card
{
cardNumber = 6; // set the inherited cardNumber data member with the card number (6 here)
}
Card6::~Card6(void)
{
}
void Card6::Apply(Grid* pGrid, Player* pPlayer)
{
///TODO: Implement this function as mentioned in the guideline steps (numbered below) below
// == Here are some guideline steps (numbered below) (numbered below) to implement this function ==
// 1- Call Apply() of the base class Card to print the message that you reached this card number
Card::Apply(pGrid, pPlayer);
// 2-move the pPlayer by the last rolled dice value
pPlayer->DecTurnCount();
pPlayer->Move(pGrid, (-1 * (pPlayer->GetJustRolledDiceNum())));
}
void Card6::Save(ofstream& OutFile)
{
OutFile << cardNumber << " " << position.GetCellNum() << endl;
}