/
CardOne.h
29 lines (19 loc) · 1.02 KB
/
CardOne.h
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
#pragma once
#include "Card.h"
// [ CardOne ] Summary:
// Its Apply() Function: Decrements the value of the passing player’s wallet by a value
// Its Parameters: The Wallet Value to decrease --> put it as a "data member" and read it in ReadCardParameters()
class CardOne : public Card
{
// CardOne Parameters:
int walletAmount; // the wallet value to decrease from the player
public:
CardOne(const CellPosition & pos); // A Constructor takes card position
virtual void ReadCardParameters(Grid * pGrid); // Reads the parameters of CardOne which is: walletAmount
virtual void Apply(Grid* pGrid, Player* pPlayer); // Applies the effect of CardOne on the passed Player
// by decrementing the player's wallet by the walletAmount data member
virtual void Save(ofstream& outFile, int Type); //save card 1 data using fstream
virtual void Open(ifstream& inFile); //load card 1 data using fstream
Card* getCopy(); //get copy of card 1
virtual ~CardOne(); // A Virtual Destructor
};