Player is an abstract class presenting a common interface for AI and Human players.
More...
#include <Player.hpp>
|
struct | cardOrder |
| A structure to automatically fix an insert order into cards' sets. More...
|
|
|
| Player (const string &name) |
| The unique constructor of Player. More...
|
|
void | addCard (const shared_ptr< Card > card) |
| Add a card among player's initial cards. More...
|
|
virtual Biddings | bid (const Biddings bestBid, const bool chelemAnnounced) const =0 |
| Pure virtual function to make a choice for biddings. More...
|
|
virtual shared_ptr< Card > | chooseKing (const Deck &deck) const =0 |
| Pure virtual function to make a choice for partnership in a 5-player game. More...
|
|
vector< shared_ptr< Card > > | getAllCards () const |
| Returns the vector of all cards in player's hand. More...
|
|
set< Announcements > | getAnnounced () const |
| Inline assessor to the set of announcements. More...
|
|
vector< shared_ptr< Card > > | getInitialCards () const |
| Inline assessor to the player's initial cards. More...
|
|
int | getNumberOudlers () const |
| Inline assessor to the number of oudlers the player has with his/her initial hand. More...
|
|
virtual set< shared_ptr< Card > > | makeEcart (const int dogSize)=0 |
| Pure virtual function to make the ecart when the player is the best bidder. More...
|
|
virtual void | newGame ()=0 |
| Pure virtual function to prepare the player for a new game. More...
|
|
virtual shared_ptr< Card > | playCard (const Suits referenceSuit, const shared_ptr< Card > highTrump)=0 |
| playCard is a pure virtual function returning the card the player chooses to play. More...
|
|
void | showCards () const |
| To print all player's cards in his/her current hand. More...
|
|
vector< shared_ptr< Card > > | validCards (const Suits referenceSuit, const shared_ptr< Card > greaterTrump) const |
| Returns the vector of cards the player can currently play, regarding the asked suit and the greater trump of the trick. More...
|
|
|
vector< shared_ptr< Card > > | callableCards (const Deck &deck) const |
| To compute the vector of cards we can call during a 5-player game. More...
|
|
void | delCard (const shared_ptr< Card > card) |
| To delete a card from the player's current hand. More...
|
|
Player is an abstract class presenting a common interface for AI and Human players.
Player::Player |
( |
const string & |
name | ) |
|
The unique constructor of Player.
- Parameters
-
void Player::addCard |
( |
const shared_ptr< Card > |
card | ) |
|
Add a card among player's initial cards.
- Parameters
-
virtual Biddings Player::bid |
( |
const Biddings |
bestBid, |
|
|
const bool |
chelemAnnounced |
|
) |
| const |
|
pure virtual |
Pure virtual function to make a choice for biddings.
- Parameters
-
bestBid | The best bid proposed so far. |
chelemAnnounced | A Boolean to know if someone has declared a chelem. |
- Returns
- The chosen bid (Biddings::none if one passes).
Implemented in AI, and Human.
vector< shared_ptr< Card > > Player::callableCards |
( |
const Deck & |
deck | ) |
const |
|
protected |
To compute the vector of cards we can call during a 5-player game.
- Parameters
-
deck | The deck used form the game. |
- Returns
- The vector of cards the taker can call (usually, the four kings).
virtual shared_ptr<Card> Player::chooseKing |
( |
const Deck & |
deck | ) |
const |
|
pure virtual |
Pure virtual function to make a choice for partnership in a 5-player game.
- Parameters
-
deck | The current deck used for the game |
- Returns
- The chosen king (or card).
Implemented in AI, and Human.
void Player::delCard |
( |
const shared_ptr< Card > |
card | ) |
|
|
protected |
To delete a card from the player's current hand.
- Parameters
-
card | The card to delete from the player's hand. |
vector< shared_ptr< Card > > Player::getAllCards |
( |
| ) |
const |
Returns the vector of all cards in player's hand.
- Returns
- The union of hearts, spades, etc, sets.
Inline assessor to the set of announcements.
vector< shared_ptr<Card> > Player::getInitialCards |
( |
| ) |
const |
|
inline |
Inline assessor to the player's initial cards.
int Player::getNumberOudlers |
( |
| ) |
const |
|
inline |
Inline assessor to the number of oudlers the player has with his/her initial hand.
virtual set< shared_ptr<Card> > Player::makeEcart |
( |
const int |
dogSize | ) |
|
|
pure virtual |
Pure virtual function to make the ecart when the player is the best bidder.
- Parameters
-
dogSize | The number of card one must include into the ecart. |
- Returns
- A set of Card pointers for the cards one places into the ecart.
Implemented in AI, and Human.
virtual void Player::newGame |
( |
| ) |
|
|
pure virtual |
Pure virtual function to prepare the player for a new game.
Implemented in AI, and Human.
virtual shared_ptr<Card> Player::playCard |
( |
const Suits |
referenceSuit, |
|
|
const shared_ptr< Card > |
highTrump |
|
) |
| |
|
pure virtual |
playCard is a pure virtual function returning the card the player chooses to play.
- Parameters
-
referenceSuit | The asked suit for the trick. |
highTrump | The highest trump played so far for the trick, if any. |
- Returns
- The chosen card to play.
Implemented in AI, and Human.
void Player::showCards |
( |
| ) |
const |
To print all player's cards in his/her current hand.
vector< shared_ptr< Card > > Player::validCards |
( |
const Suits |
referenceSuit, |
|
|
const shared_ptr< Card > |
greaterTrump |
|
) |
| const |
Returns the vector of cards the player can currently play, regarding the asked suit and the greater trump of the trick.
- Parameters
-
referenceSuit | The asked suit for the trick. |
greaterTrump | A pointer on the greater trump of the trick, if any. |
- Returns
- The vector of all cards the player can play in his/her situation.
The set of announcements (for what?).
The set of Clubs owned by the player.
The set of Diamonds owned by the player.
shared_ptr<Card> Player::fool |
|
protected |
The pointer toward the Fool, if owned by the player.
The set of Hearts owned by the player.
vector< shared_ptr<Card> > Player::initialCards |
|
protected |
The vector of player's initial cards, from his/her starting hand.
double Player::initialPoints |
|
protected |
The number of points the player has with his/her initial cards.
int Player::numberOudlers |
|
protected |
The number of oudlers the player has among his/her initial cards.
The set of Spades owned by the player.
The set of trumps owned by the player.
The documentation for this class was generated from the following files: