-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathPlayer.hpp
More file actions
46 lines (39 loc) · 1.48 KB
/
Copy pathPlayer.hpp
File metadata and controls
46 lines (39 loc) · 1.48 KB
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
#pragma once
#include <string>
#include <vector>
#include "Tile.hpp"
#include "Card.hpp"
#include "Deck.hpp"
using namespace std;
enum PLAYER_STATUS { ACTIVE, BANKRUPT, JAILED };
enum CARD_EFFECT { NOEFFECT, DISCOUNT, SHIELD };
class Player {
private:
string username;
int currency;
PLAYER_STATUS currentStatus;
CardDeck<SkillCard> deck;
Tile* currentTile;
vector<Tile*> ownedProperties;
float discountValue;
int jailTurnCount;
bool canUseCard;
public:
// getter
string getUsername() const { return username; };
int getCurrency() const { return currency; };
PLAYER_STATUS getStatus() const { return currentStatus; };
CardDeck<SkillCard> getDeck() const { return deck; };
Tile* getCurrentTile() const { return currentTile; }
vector<Tile*> getOwnedProperties() const { return ownedProperties; };
float getDiscount() const { return discountValue; };
int getJailTurn() const { return jailTurnCount; };
bool canUseCard() const { return canUseCard; };
// specific method
void buyBackMortgaged(Tile* mortgaged);
Player* operator+=(int money); // untuk proses penambahan currency
Player* operator-=(int money); // untuk proses pengurangan currency
void moveTo(Tile* destination, bool getPayment);
void mortgageProperty(Tile* property); // ubah status Tile jadi mortgaged
void setToJailed();
};