-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCard.cpp
49 lines (34 loc) · 1.05 KB
/
Card.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
#include "Card.h"
int Card::GetCardNumber()
{
return cardNumber;
}
Card::Card(const CellPosition& pos) : GameObject(pos) // sets the cell position of the GameObject
{
}
bool Card::IsOverlapping(GameObject* g) {
return false;
}
void Card::Draw(Output* pOut) const
{
///TODO: call the appropriate Ouput function that draws a cell containing the "cardNumber" in "position"
pOut->DrawCell(position, cardNumber);
}
void Card::ReadCardParameters(Grid * pGrid)
{
// we should not make it pure virtual because some Cards doesn't have parameters
// and if we make it pure virtual, that will make those Cards abstract classes
}
Card* Card::CopyCard(CellPosition)
{
return nullptr;
}
void Card::Apply(Grid* pGrid, Player* pPlayer)
{
// As written below the "Roll Dice" action in the document ==> Check the Project Document
// "If a player reaches a card of any other type", the following message should be printed then wait mouse click
pGrid->PrintErrorMessage("You have reached card " + to_string(cardNumber) + ". Click to continue ...");
}
Card::~Card()
{
}