-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.h
79 lines (59 loc) · 1.72 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#pragma once
#include "BasicNotes.h"
#include <vector>
#include <iostream>
class Game;
class Player
{
public:
Player();
~Player();
// Gives players of game, and position of self
virtual void SetPlayers(std::vector<std::shared_ptr<Player>> players, int self);
//Called by Game to signal the player to start their move
virtual void DoTurn();
// Another player showed a card to another player
virtual void CardExchanged(std::shared_ptr<Player> Shower, std::shared_ptr<Player> Receiver, CardSet AskedCards) {};
virtual void CardNotExchanged(std::shared_ptr<Player> Shower, std::shared_ptr<Player> Receiver, CardSet AskedCards) {};
bool bHasLost = false;
virtual void Lose();
virtual void Win();
// Prepare for another game
virtual void Reset();
// shared pointer to self
std::shared_ptr<Player> self = nullptr;
// Returns Cardset or null if player does not have any of the cards
virtual CardSet OnAsked(CardSet Selection, std::shared_ptr<Player> Asker);
Game* CurrentGame = nullptr;
void AddStartingCard(CardSet* card, int index);
//Notes
BasicNotes notes;
int wins = 0;
protected:
// 5 + 5 + 8 possible cards = 18, min 2 players
CardSet* StartingCards[9];
struct Decisions
{
bool bMoveRooms = false;
RoomCard DestinationRoom;
CardSet AskSelection;
bool WillConvict;
};
Decisions decisions;
RoomCard CurrentRoom;
//Decide flags in Decisions
virtual void Decide();
// Possible actions during turn
virtual void Move();
virtual CardSet Ask();
virtual void Convict();
};
class RegularPlayer : public Player
{
public:
RegularPlayer() {};
void Reset() override
{
std::cout << "I am RegularPlayer" << std::endl;
}
};