-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCardThree.cpp
43 lines (35 loc) · 954 Bytes
/
CardThree.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
#include "CardThree.h"
#include "AddCardAction.h"
#include "RollDiceAction.h"
#include "Action.h"
#include "ApplicationManager.h"
CardThree::CardThree(const CellPosition& pos):Card(pos)
{
cardNumber = 3; // set the inherited cardNumber data member with the card number (3 here)
}
void CardThree::ReadCardParameters(Grid* pGrid)
{
}// Reads the parameters of CardTwo which is: walletAmount
void CardThree::Apply(Grid* pGrid, Player* pPlayer)
{
Card::Apply(pGrid, pPlayer);
for (int i = 0; i < 3; i++)
{
pGrid->AdvanceCurrentPlayer();
}
pPlayer->SetTurnCount(pPlayer->GetTurnCount() - 1);
}// Applies the effect of CardTwo on the passed Player
void CardThree::Save(ofstream& OutFile) {
Card::Save(OutFile);
}
void CardThree::Load(ifstream& Infile) {
Card::Load(Infile);
}
Card* CardThree::Copy(Card* pCard) {
CellPosition pos;
CardThree* copy = new CardThree(pos);
return copy;
}
CardThree::~CardThree()
{
}// A Virtual Destructor