|
NetMauMau
0.24.0
Client API
|
Common classes and functions used by clients and server as well
#include "cardtools.h" to use the tool functions.
Namespaces | |
| namespace | 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. | |
| std::string | ansiSuit (const std::string &suit) |
Converts a SUIT symbol to a ANSI color representation. | |
| NetMauMau::Common::ICard::SUIT | symbolToSuit (const std::string &symbol) |
| Converts a symbol to a NetMauMau::Common::ICard::SUIT. | |
| std::string | suitToSymbol (NetMauMau::Common::ICard::SUIT suit, bool ansi, bool endansi=false) |
| Converts a NetMauMau::Common::ICard::SUIT to a symbol. | |
Card description | |
| bool | parseCardDesc (const std::string &desc, NetMauMau::Common::ICard::SUIT *suit, NetMauMau::Common::ICard::RANK *rank) |
| Parses a textual description. | |
| std::string | createCardDesc (NetMauMau::Common::ICard::SUIT suite, NetMauMau::Common::ICard::RANK rank, bool ansi) |
| Creates a card description. | |
Sorting cards | |
| unsigned int | suitOrderPosition (NetMauMau::Common::ICard::SUIT suit) |
Gets an ordinal number for a SUIT. | |
| unsigned int | rankOrderPosition (NetMauMau::Common::ICard::RANK rank) |
Gets an ordinal number for a RANK. | |
| bool | cardEqual (const NetMauMau::Common::ICard *lhs, const NetMauMau::Common::ICard *rhs) |
| Checks if two cards are equal. | |
| bool | cardLess (const NetMauMau::Common::ICard *lhs, const NetMauMau::Common::ICard *rhs) |
| Checks if a card comes before another. | |
| bool | cardGreater (const NetMauMau::Common::ICard *lhs, const NetMauMau::Common::ICard *rhs) |
| Checks if a card comes before another. | |
Identifying and finding cards | |
| bool | isSuit (const NetMauMau::Common::ICard *card, NetMauMau::Common::ICard::SUIT suit) |
Checks if the a card is of SUIT. | |
| bool | isRank (const NetMauMau::Common::ICard *card, NetMauMau::Common::ICard::RANK rank) |
Checks if the a card is of RANK. | |
| template<typename Tp , typename Iterator > | |
| std::iterator_traits< Iterator > ::value_type | find (Tp arg, Iterator first, Iterator last) |
| Generic find function. | |
| 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. | |
| 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. | |
| 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. | |
Miscellaneous functions | |
| NetMauMau::Common::ICard * | getIllegalCard () |
| Gets an illegal card card to trigger special actions. | |
| std::size_t | getCardPoints (NetMauMau::Common::ICard::RANK rank) |
Gets the points of a RANK. | |
| 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. | |
| const char * | getServerExe () |
| Gets the executable name of the server. | |
Variables | |
| const std::string | DefaultPlayerImage |
std::string containing the default player image in PNG format | |
1.8.1.2