-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCardFive.cpp
41 lines (28 loc) · 814 Bytes
/
CardFive.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
#include "CardFive.h"
#include "Player.h"
CardFive::CardFive(const CellPosition& pos):Card(pos)
{
cardNumber = 5; // set the inherited cardNumber data member with the card number (5 here)
}
void CardFive::ReadCardParameters(Grid* pGrid)
{
}
void CardFive::Apply(Grid* pGrid, Player* pPlayer)
{
Card::Apply(pGrid, pPlayer);
pPlayer->Move(pGrid,(-1* pPlayer->GetJustRolledDiceNum())); //Moving in the negative direction with the just rolled dice number
}// Applies the effect of CardFive on the passed Player
void CardFive::Save(ofstream& OutFile) {
Card::Save(OutFile);
}
void CardFive::Load(ifstream& Infile) {
Card::Load(Infile);
}
Card* CardFive::Copy(Card* pCard) {
CellPosition pos;
CardFive* copy = new CardFive(pos);
return copy;
}
CardFive::~CardFive()
{
}// A Virtual Destructor