-
Notifications
You must be signed in to change notification settings - Fork 0
/
DecWalletCard_1.h
32 lines (19 loc) · 1.12 KB
/
DecWalletCard_1.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
29
30
31
#pragma once
#include "Card.h"
// [ DecWalletCard_1 ] 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 DecWalletCard_1 : public Card
{
// DecWalletCard_1 Parameters:
int walletAmount; // the wallet value to decrease from the player
public:
DecWalletCard_1(const CellPosition & pos); // A Constructor takes card position
DecWalletCard_1(); // Default Constructor
virtual void ReadCardParameters(Grid * pGrid); // Reads the parameters of DecWalletCard_1 which is: walletAmount
virtual void Apply(Grid* pGrid, Player* pPlayer); // Applies the effect of DecWalletCard_1 on the passed Player
// by decrementing the player's wallet by the walletAmount data member
virtual void Save(ofstream& outFile, Type gameObj); // Saves the position and wallet amount to decrease in a file
virtual void Load(ifstream& InFile); // Reads the data members from a file
virtual ~DecWalletCard_1(); // A Virtual Destructor
};