-
Notifications
You must be signed in to change notification settings - Fork 1
/
card12.cpp
47 lines (40 loc) · 1.19 KB
/
card12.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 "card12.h"
#include<fstream>
card12::card12(const CellPosition & pos) : Card(pos) // set the cell position of the card
{
cardNumber = 12;// set the inherited cardNumber data member with the card number (12 here)
name="000";
}
card12::~card12(void)
{
}
void card12::ReadCardParameters(Grid * pGrid)
{
pGrid->PrintErrorMessage("wooow Take any city enter its name,click to continue :)");
name=pGrid->GetInput()->GetSrting(pGrid->GetOutput());
pGrid->GetOutput()->ClearStatusBar();
}
void card12::Apply(Grid* pGrid, Player* pPlayer)
{
if(name=="Cairo")
pGrid->setmonopoly(7,pPlayer->getpnum());
else if(name=="Alexandria")
pGrid->setmonopoly(8,pPlayer->getpnum());
else if(name=="Aswan")
pGrid->setmonopoly(9,pPlayer->getpnum());
else if(name=="Luxor")
pGrid->setmonopoly(10,pPlayer->getpnum());
else if(name=="Hurghada")
pGrid->setmonopoly(7,pPlayer->getpnum());
else
pGrid->PrintErrorMessage("INVALID CITY NAME");
}
void card12::Save(ofstream& OutFile, Grid* pGrid, int typ)
{
Card::Save(OutFile, pGrid, typ);
OutFile << name << endl;
}
void card12::Load(ifstream& InFile, Grid* pGrid, int typ)
{
InFile >> name;
}