Mari's Tarot
 All Classes Files Functions Variables Enumerations Enumerator Friends
Public Member Functions | Friends | List of all members
Card Class Reference

Card is the class compiling all useful information on cards: points, suit, value... More...

#include <Card.hpp>

Collaboration diagram for Card:
Collaboration graph

Public Member Functions

 Card (const Suits suit, const int value, const double points, const bool oudler)
 The unique constructor for Card. More...
 
int computeIndex () const
 Returns the card index in the deck before shuffle. Used for the GUI. More...
 
double getPoints () const
 Inline assessor to get the card's points. More...
 
Suits getSuit () const
 Inline assessor to get the card's suit. More...
 
int getValue () const
 Inline assessor to get the card's value. More...
 
bool isComparable (const Card &card) const
 A function to decide if two cards are comparable. More...
 
bool isFaceCard () const
 Inline function returning true iif the card is a face card. More...
 
bool isFool () const
 Inline function returning true iif the card is the Fool. More...
 
bool isOudler () const
 Inline function returning true iif the card is an oudler. More...
 
bool isTrump () const
 Inline function returning true iif the card is a trump. More...
 
bool operator> (const Card &card) const
 A greater-than comparator to make easier the comparison between cards. More...
 
bool operator< (const Card &card) const
 A less-than comparator to make easier the comparison between cards. More...
 
bool operator== (const Card &card) const
 An equal comparator to make easier the comparison between cards. More...
 

Friends

ostream & operator<< (ostream &, const Card &)
 Surcharging << to make std::cout easier. More...
 

Detailed Description

Card is the class compiling all useful information on cards: points, suit, value...

Constructor & Destructor Documentation

Card::Card ( const Suits  suit,
const int  value,
const double  points,
const bool  oudler 
)

The unique constructor for Card.

Parameters
suitThe card's suit.
valueIts value (11, 12, 13 and 14 for a Jack, Knigh, Queen and King, respectively).
pointsIts points, needing a real value.
oudlerA Boolean set to true iff the card is an oudler.

Member Function Documentation

int Card::computeIndex ( ) const

Returns the card index in the deck before shuffle. Used for the GUI.

double Card::getPoints ( ) const
inline

Inline assessor to get the card's points.

Suits Card::getSuit ( ) const
inline

Inline assessor to get the card's suit.

int Card::getValue ( ) const
inline

Inline assessor to get the card's value.

bool Card::isComparable ( const Card card) const
inline

A function to decide if two cards are comparable.

Decides if the two involved cards are comparable, i.e., from the same suit or be trump.

Parameters
cardAnother card.
Returns
True iff the two cards are comparable.
bool Card::isFaceCard ( ) const
inline

Inline function returning true iif the card is a face card.

bool Card::isFool ( ) const
inline

Inline function returning true iif the card is the Fool.

bool Card::isOudler ( ) const
inline

Inline function returning true iif the card is an oudler.

bool Card::isTrump ( ) const
inline

Inline function returning true iif the card is a trump.

bool Card::operator< ( const Card card) const

A less-than comparator to make easier the comparison between cards.

Parameters
cardThe card one's compared with.
Returns
true iff the given card is greater than the left hand side card. Cards must be comparable, i.e., from the same suit or be trump.
bool Card::operator== ( const Card card) const

An equal comparator to make easier the comparison between cards.

Parameters
cardThe card one's compared with.
Returns
true iff the two cards are the same.
bool Card::operator> ( const Card card) const

A greater-than comparator to make easier the comparison between cards.

Parameters
cardThe card one's compared with.
Returns
true iff the given card is smaller than the left hand side card. Cards must be comparable, i.e., from the same suit or be trump.

Friends And Related Function Documentation

ostream& operator<< ( ostream &  os,
const Card card 
)
friend

Surcharging << to make std::cout easier.


The documentation for this class was generated from the following files: