-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBoard.h
63 lines (54 loc) · 1.91 KB
/
Board.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 BOARD_H
#define BOARD_H
#include <memory>
#include <vector>
#include "Cards.h"
#include "Minions.h"
class Player;
class Board
{
private:
// A vector of cards on the board
std::vector<std::unique_ptr<Card>> m_player1_cards;
std::vector<std::unique_ptr<Card>> m_player2_cards;
// Vector of cards that have been destroyed
std::vector<std::unique_ptr<Card>> m_destroyed_cards;
public:
Board(){};
~Board()
{
};
// Get a view of the cards of a certain player
std::vector<std::reference_wrapper<Card>> getPlayerCardsView(const Player &player) const;
// Get a view of the cards of an other player
std::vector<std::reference_wrapper<Card>> getOtherPlayerCardsView(const Player &player) const;
// Get a view of the cards with taunt effect of a certain player
std::vector<std::reference_wrapper<Card>> getPlayerCardsViewWithTaunt(const Player &player) const;
// Get a view of the cards with taunt effect of an other player
std::vector<std::reference_wrapper<Card>> getOtherPlayerCardsViewWithTaunt(const Player &player) const;
// Get the number of cards of the player
int getNumberOfCards(const Player &player) const;
// Get Cards of the board
std::vector<std::reference_wrapper<Card>> getCardsView();
// Get the cards of a certain type on the board and own by a certain player
void addCardLeft(std::unique_ptr<Card> &card);
void addCardRight(std::unique_ptr<Card> &card);
void destroyCard(Card &card);
void destroyCards();
int getCardIndex(Card &card) const;
std::unique_ptr<Card> popCard(int index, Player &player);
// Print the cards on the board
void printCards()
{
std ::cout << "Cards on the board: " << '\n';
for (auto &card : m_player1_cards)
{
card->print();
}
for (auto &card : m_player2_cards)
{
card->print();
}
}
};
#endif