-
Notifications
You must be signed in to change notification settings - Fork 1
/
CardEleven.cpp
58 lines (46 loc) · 1.18 KB
/
CardEleven.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
48
49
50
51
52
53
54
55
56
57
58
#include "CardEleven.h"
int CardEleven::CardPrice = 0;
int CardEleven::fees = 0;
Player* CardEleven::p = NULL;
bool CardEleven::IsBought = 0;
CardEleven::CardEleven(const CellPosition& pos) : Cards_9_11(pos) // set the cell position of the card
{
cardNumber = 11; // set the inherited cardNumber data member with the card number (9 here)
}
Card* CardEleven::GetCopy(const CellPosition& pos)
{
return new CardEleven(pos);
}
Player* CardEleven::GetPlayer() {
return p;
}
int CardEleven::GetCardPrice() {
return CardPrice;
}
void CardEleven::SetPlayer(Player* player) {
p = player;
}
void CardEleven::ReadCardParameters(Grid* pGrid)
{
Cards_9_11::ReadCardParameters(pGrid, CardPrice, fees, p, IsBought);
}
void CardEleven::Apply(Grid* pGrid, Player* pPlayer)
{
Cards_9_11::Apply(pGrid, pPlayer, CardPrice, fees, p, IsBought);
}
bool CardEleven::CheckInputValidity()
{
bool validity = Cards_9_11::CheckInputValidity(CardPrice, fees);
return validity;
}
void CardEleven::Save(ofstream& outFile, ObjectType ObjType)
{
Cards_9_11::Save(outFile, ObjType, CardPrice, fees);
}
void CardEleven::Load(ifstream& InFile)
{
Cards_9_11::Load(InFile, CardPrice, fees);
}
CardEleven::~CardEleven(void)
{
}