NetMauMau  0.24.0
Client API
Namespaces | Classes | Variables
NetMauMau::Common Namespace Reference

Detailed Description

Common classes and functions used by clients and server as well

#include "cardtools.h" to use the tool functions.

Namespaces

 Exception
 Exceptions thrown in both clients and the server.
 

Classes

class  AbstractConnection
 Abstract connection class. More...
 
struct  cardGreaterThan
 Functor to compare cards. More...
 
struct  cardLessThan
 Functor to compare cards. More...
 
struct  equalTo
 Generic equality functor. More...
 
interface  ICard
 Describes a playing card. More...
 
interface  IConnection
 Interface to a connection. More...
 

Functions

Card SUIT helpers
const std::string * getSuitSymbols ()
 Get an array of the four SUIT symbols. More...
 
std::string ansiSuit (const std::string &suit)
 Converts a SUIT symbol to a ANSI color representation. More...
 
NetMauMau::Common::ICard::SUIT symbolToSuit (const std::string &symbol)
 Converts a symbol to a NetMauMau::Common::ICard::SUIT. More...
 
std::string suitToSymbol (NetMauMau::Common::ICard::SUIT suit, bool ansi, bool endansi=false)
 Converts a NetMauMau::Common::ICard::SUIT to a symbol. More...
 
Card description
bool parseCardDesc (const std::string &desc, NetMauMau::Common::ICard::SUIT *suit, NetMauMau::Common::ICard::RANK *rank)
 Parses a textual description. More...
 
std::string createCardDesc (NetMauMau::Common::ICard::SUIT suite, NetMauMau::Common::ICard::RANK rank, bool ansi)
 Creates a card description. More...
 
Sorting cards
unsigned int suitOrderPosition (NetMauMau::Common::ICard::SUIT suit)
 Gets an ordinal number for a SUIT. More...
 
unsigned int rankOrderPosition (NetMauMau::Common::ICard::RANK rank)
 Gets an ordinal number for a RANK. More...
 
bool cardEqual (const NetMauMau::Common::ICard *lhs, const NetMauMau::Common::ICard *rhs)
 Checks if two cards are equal. More...
 
bool cardLess (const NetMauMau::Common::ICard *lhs, const NetMauMau::Common::ICard *rhs)
 Checks if a card comes before another. More...
 
bool cardGreater (const NetMauMau::Common::ICard *lhs, const NetMauMau::Common::ICard *rhs)
 Checks if a card comes before another. More...
 
Identifying and finding cards
bool isSuit (const NetMauMau::Common::ICard *card, NetMauMau::Common::ICard::SUIT suit)
 Checks if the a card is of SUIT. More...
 
bool isRank (const NetMauMau::Common::ICard *card, NetMauMau::Common::ICard::RANK rank)
 Checks if the a card is of RANK. More...
 
template<typename Tp , typename Iterator >
std::iterator_traits< Iterator >
::value_type 
find (Tp arg, Iterator first, Iterator last)
 Generic find function. More...
 
template<typename Iterator >
std::iterator_traits< Iterator >
::value_type 
findSuit (NetMauMau::Common::ICard::SUIT suit, Iterator first, Iterator last)
 Finds the first card of a given SUIT. More...
 
template<typename Iterator >
std::iterator_traits< Iterator >
::value_type 
findRank (NetMauMau::Common::ICard::RANK rank, Iterator first, Iterator last)
 Finds the first card of a given RANK. More...
 
template<typename Iterator >
std::iterator_traits< Iterator >
::value_type 
findCard (typename Iterator::value_type card, Iterator first, Iterator last)
 Finds the first card equal to a given card. More...
 
Miscellaneous functions
NetMauMau::Common::ICardgetIllegalCard ()
 Gets an illegal card card to trigger special actions. More...
 
std::size_t getCardPoints (NetMauMau::Common::ICard::RANK rank)
 Gets the points of a RANK. More...
 
CARDCONFIG getCardConfig (std::size_t players, std::size_t initialCardCount=5, std::size_t decks=1)
 Determines reasonable amounts of initial cards and card decks. More...
 
const char * getServerExe ()
 Gets the executable name of the server. More...
 

Variables

const std::string DefaultPlayerImage
 std::string containing the default player image in PNG format More...