-
Notifications
You must be signed in to change notification settings - Fork 0
/
CardFour.cpp
47 lines (41 loc) · 1.04 KB
/
CardFour.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
44
45
46
47
#include "CardFour.h"
CardFour:: CardFour(const CellPosition& pos):Card(pos) // A Constructor takes card position
{
CardCount++;
cardNumber = 4;
}
void CardFour:: Apply(Grid* pGrid, Player* pPlayer)
{
Card::Apply(pGrid, pPlayer); // output card number
Output* pOut = pGrid->GetOutput();
pGrid->PrintErrorMessage("You reached Card 4! You can't roll next turn! click to continue" );
pPlayer->SetDoNotPlay(1); /*DoNotPlay is a data member in Player used to indicate if the player has an
extra dice roll(-1),cancelled dice roll (1) or in the prision(3)
if DoNotPlay=0 he will play normally */
pOut->ClearStatusBar();
}
//paste Card
Card* CardFour::PasteCard()
{
Card* copy = new CardFour(0);
return copy;
}
//Copy Card
Card* CardFour::CopyCard()
{
Card* copy = new CardFour(0);
CardCount--;
return copy;
}
//Save Card
void CardFour::Save(ofstream& OutFile, Object_Type obj)
{
if (obj != card)
return;
Card::Save(OutFile, obj);
OutFile << endl;
}
CardFour::~CardFour(void)
{
CardCount--;
}