-
Notifications
You must be signed in to change notification settings - Fork 0
/
player.h
63 lines (51 loc) · 1.85 KB
/
player.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef PLAYER_H
#define PLAYER_H
#include "card.h"
#include "card_set.h"
#include "game.h"
#include "strategy.h"
class Game;
class Player {
public:
Player();
void Shuffle(std::mt19937& g);
void DrawToHand(std::mt19937& g);
void DrawFromDeck(int n, CardSet* dest, std::mt19937& g);
void PutDiscardPileInDeckAndShuffle(std::mt19937& g);
void PlayTurn(Game* game, const Strategy* strategy, std::mt19937& g);
void BuyCleanUpAndDraw(Game* game, const Strategy* strategy,
const vector<Card>& cards_to_buy, std::mt19937& g);
void ActionPhase(Game* game, const Strategy* strategy, std::mt19937& g);
bool PlayAction(Game* game, const Strategy* strategy,
std::mt19937& g);
void PlayAction(Game* game, const Strategy* strategy, const Card* card,
std::mt19937& g);
int FindCardIndexInHand(CardName card_name) const;
void BuyPhase(Game* game, const Strategy* strategy, std::mt19937& g);
void PlayAllTreasures(Game* game);
bool PlayTreasure(Game* game);
void PlayCardAsTreasure(int i, Game* game);
void BuyCard(Game* game, const Strategy* strategy, CardName);
bool CanBuyWith(const Card& card, int coins, const Game* game) const;
void CleanUp(Game* game, const Strategy* strategy);
void CleanUpCardFromPlay(Game* game, const Strategy* strategy, int i);
bool ShouldDiscardFromPlay(Game* game, const Strategy* strategy,
const Card& card);
void CleanUpCardFromHand(Game* game, const Strategy* strategy, int i);
bool ShouldDiscardFromHand(Game* game, const Strategy* strategy,
const Card& card);
void InitializeTurn(Game* game);
void InflateCardsInHand();
void ReinflateCardsInHand();
void ShowHand() const;
void ShowInPlay() const;
CardSet deck;
CardSet hand;
CardSet discard_pile;
std::vector<Card> cards_in_hand;
std::vector<Card> cards_in_play;
int actions;
int buys;
int coins;
};
#endif