NetMauMau  0.24.0
Client API
Classes | Macros | Variables
Utilities

Detailed Description

Utilities and helper functions and macros.

This are several utilities and helper functions and macros to ease the use of the NetMauMau client API

Classes

struct  CARDCONFIG
 Structure containing the configuration of initial cards and decks. More...
 
struct  NetMauMau::Common::cardGreaterThan< T >
 Functor to compare cards. More...
 
struct  NetMauMau::Common::cardLessThan< T >
 Functor to compare cards. More...
 
struct  NetMauMau::Common::equalTo< CardType, Tp >
 Generic equality functor. More...
 

Macros

#define MAKE_VERSION(maj, min)
 
#define MAKE_VERSION_REL(maj, min, rel)
 
#define VERSION_MAJ(v)
 
#define VERSION_MIN(v)
 
#define VERSION_REL(v)
 

Variables

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

Server query methods

static uint32_t NetMauMau::Client::AbstractClientV05::getClientProtocolVersion ()
 Returns the version of the client's implemented protocol. More...
 
static uint32_t NetMauMau::Client::AbstractClientV05::getClientLibraryVersion ()
 Returns the version of the client library. More...
 
static uint32_t NetMauMau::Client::AbstractClientV05::parseProtocolVersion (const std::string &version)
 Parses a version string and returns the resulting protocol version. More...
 
static bool NetMauMau::Client::AbstractClientV05::isPlayerImageUploadable (const unsigned char *pngData, std::size_t pngDataLen)
 Checks if an player image is uploadable to the server. More...
 
static uint16_t NetMauMau::Client::AbstractClientV05::getDefaultPort ()
 Gets the default port of the server. More...
 
static const char * NetMauMau::Client::AbstractClientV05::getDefaultAIName ()
 Gets the compiled in default AI player name. More...
 
CAPABILITIES NetMauMau::Client::AbstractClientV05::capabilities (timeval *timeout=NULL) throw (NetMauMau::Common::Exception::SocketException)
 Returns the server capabilities. More...
 
PLAYERINFOS NetMauMau::Client::AbstractClientV05::playerList (bool playerPNG, timeval *timeout=NULL) throw (NetMauMau::Common::Exception::SocketException)
 Returns the list of currently registered player names. More...
 
PLAYERLIST NetMauMau::Client::AbstractClientV05::playerList (timeval *timeout=NULL) throw (NetMauMau::Common::Exception::SocketException)
 Returns the list of currently registered player names. More...
 
std::string NetMauMau::Client::AbstractClientV05::getPlayerName () const
 Gets the player's name. More...
 

Server query methods

static bool NetMauMau::Client::AbstractClientV11::isPlayerImageUploadable (const unsigned char *pngData, std::size_t pngDataLen, const IBase64 *base64)
 Checks if an player image is uploadable to the server. More...
 

Card SUIT helpers

const std::string * NetMauMau::Common::getSuitSymbols ()
 Get an array of the four SUIT symbols. More...
 
std::string NetMauMau::Common::ansiSuit (const std::string &suit)
 Converts a SUIT symbol to a ANSI color representation. More...
 
NetMauMau::Common::ICard::SUIT NetMauMau::Common::symbolToSuit (const std::string &symbol)
 Converts a symbol to a NetMauMau::Common::ICard::SUIT. More...
 
std::string NetMauMau::Common::suitToSymbol (NetMauMau::Common::ICard::SUIT suit, bool ansi, bool endansi=false)
 Converts a NetMauMau::Common::ICard::SUIT to a symbol. More...
 

Card description

bool NetMauMau::Common::parseCardDesc (const std::string &desc, NetMauMau::Common::ICard::SUIT *suit, NetMauMau::Common::ICard::RANK *rank)
 Parses a textual description. More...
 
std::string NetMauMau::Common::createCardDesc (NetMauMau::Common::ICard::SUIT suite, NetMauMau::Common::ICard::RANK rank, bool ansi)
 Creates a card description. More...
 

Sorting cards

unsigned int NetMauMau::Common::suitOrderPosition (NetMauMau::Common::ICard::SUIT suit)
 Gets an ordinal number for a SUIT. More...
 
unsigned int NetMauMau::Common::rankOrderPosition (NetMauMau::Common::ICard::RANK rank)
 Gets an ordinal number for a RANK. More...
 
bool NetMauMau::Common::cardEqual (const NetMauMau::Common::ICard *lhs, const NetMauMau::Common::ICard *rhs)
 Checks if two cards are equal. More...
 
bool NetMauMau::Common::cardLess (const NetMauMau::Common::ICard *lhs, const NetMauMau::Common::ICard *rhs)
 Checks if a card comes before another. More...
 
bool NetMauMau::Common::cardGreater (const NetMauMau::Common::ICard *lhs, const NetMauMau::Common::ICard *rhs)
 Checks if a card comes before another. More...
 

Identifying and finding cards

bool NetMauMau::Common::isSuit (const NetMauMau::Common::ICard *card, NetMauMau::Common::ICard::SUIT suit)
 Checks if the a card is of SUIT. More...
 
bool NetMauMau::Common::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 
NetMauMau::Common::find (Tp arg, Iterator first, Iterator last)
 Generic find function. More...
 
template<typename Iterator >
std::iterator_traits< Iterator >
::value_type 
NetMauMau::Common::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 
NetMauMau::Common::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 
NetMauMau::Common::findCard (typename Iterator::value_type card, Iterator first, Iterator last)
 Finds the first card equal to a given card. More...
 

Miscellaneous functions

NetMauMau::Common::ICardNetMauMau::Common::getIllegalCard ()
 Gets an illegal card card to trigger special actions. More...
 
CARDCONFIG NetMauMau::Common::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 * NetMauMau::Common::getServerExe ()
 Gets the executable name of the server. More...
 
std::size_t NetMauMau::Common::getCardPoints (NetMauMau::Common::ICard::RANK rank)
 Gets the points of a RANK. More...
 

Global compare and relational operators

bool operator== (const NetMauMau::Common::ICard &card, NetMauMau::Common::ICard::RANK rank)
 Compares a card against a rank. More...
 
bool operator!= (const NetMauMau::Common::ICard &card, NetMauMau::Common::ICard::RANK rank)
 Compares a card against a rank. More...
 
bool operator== (const NetMauMau::Common::ICard &card, NetMauMau::Common::ICard::SUIT suit)
 Compares a card against a suit. More...
 
bool operator!= (const NetMauMau::Common::ICard &card, NetMauMau::Common::ICard::SUIT suit)
 Compares a card against a suit. More...
 
bool operator== (const NetMauMau::Common::ICard &lhs, const NetMauMau::Common::ICard &rhs)
 Compares cards. More...
 
bool operator!= (const NetMauMau::Common::ICard &lhs, const NetMauMau::Common::ICard &rhs)
 Compares cards. More...
 
bool operator< (const NetMauMau::Common::ICard &lhs, const NetMauMau::Common::ICard &rhs)
 Compares cards. More...
 
bool operator> (const NetMauMau::Common::ICard &lhs, const NetMauMau::Common::ICard &rhs)
 Compares cards. More...
 
bool operator== (const NetMauMau::Common::ICard *card, NetMauMau::Common::ICard::RANK rank)
 Compares a card against a rank. More...
 
bool operator!= (const NetMauMau::Common::ICard *card, NetMauMau::Common::ICard::RANK rank)
 Compares a card against a rank. More...
 
bool operator== (const NetMauMau::Common::ICard *card, NetMauMau::Common::ICard::SUIT suit)
 Compares a card against a suit. More...
 
bool operator!= (const NetMauMau::Common::ICard *card, NetMauMau::Common::ICard::SUIT suit)
 Compares a card against a suit. More...
 

Macro Definition Documentation

#define MAKE_VERSION (   maj,
  min 
)

#include <iconnection.h>

Computes the corresponding version number integer to an usigned 32 bit integer

Parameters
majthe major of the version number
minthe minor of the version number
Since
0.8

Referenced by NetMauMau::Client::AbstractClientV05::getClientProtocolVersion(), and NetMauMau::Client::AbstractClientV05::parseProtocolVersion().

#define MAKE_VERSION_REL (   maj,
  min,
  rel 
)

#include <iconnection.h>

Computes the corresponding version number integer to an usigned 32 bit integer

Note
Release version differ only for security and bugfix releases which are NEITHER adding new features NOR changing the protocol.
Parameters
majthe major of the version number
minthe minor of the version number
relthe release of the version number
Since
0.17.0

Referenced by NetMauMau::Client::AbstractClientV05::getClientLibraryVersion(), and NetMauMau::Client::AbstractClientV05::parseProtocolVersion().

#define VERSION_MAJ (   v)

#include <iconnection.h>

Gets the major number of the version as unsigned 16 bit integer

Parameters
vthe version number
Since
0.17.0
#define VERSION_MIN (   v)

#include <iconnection.h>

Gets the minor number of the version as unsigned 16 bit integer

Parameters
vthe version number
Since
0.17.0
#define VERSION_REL (   v)

#include <iconnection.h>

Gets the release number of the version as unsigned 16 bit integer

Parameters
vthe version number
Since
0.17.0

Function Documentation

std::string NetMauMau::Common::ansiSuit ( const std::string &  suit)

#include <cardtools.h>

Converts a SUIT symbol to a ANSI color representation.

Parameters
suitthe SUIT symbol
Returns
a SUIT symbol in ANSI color representation

References NetMauMau::Common::suitToSymbol(), and NetMauMau::Common::symbolToSuit().

Connection::CAPABILITIES AbstractClientV05::capabilities ( timeval *  timeout = NULL)
throw (NetMauMau::Common::Exception::SocketException
)

#include <abstractclient.h>

Returns the server capabilities.

Parameters
timeoutthe time to wait for a connection, if NULL there will be no timeout
Exceptions
Common::Exception::SocketExceptionif the connection failed
Client::Exception::CapabilitiesExceptionif the capabilities cannot get retrieved
Client::Exception::TimeoutExceptionif the connection attempt timed out
Returns
the server capabilities
bool NetMauMau::Common::cardEqual ( const NetMauMau::Common::ICard lhs,
const NetMauMau::Common::ICard rhs 
)

#include <cardtools.h>

Checks if two cards are equal.

Deprecated:
use the generic NetMauMau::Common::equalTo instead
Parameters
lhsa card
rhsa card
Returns
true if the cards are equal, false otherwise
bool NetMauMau::Common::cardGreater ( const NetMauMau::Common::ICard lhs,
const NetMauMau::Common::ICard rhs 
)

#include <cardtools.h>

Checks if a card comes before another.

Useful for sorting with rank first than suit

Deprecated:
use the compare operators (see Utilities)
Parameters
lhsa card
rhsa card
Returns
true if lhs comes before rhs, false otherwise
Since
0.3
bool NetMauMau::Common::cardLess ( const NetMauMau::Common::ICard lhs,
const NetMauMau::Common::ICard rhs 
)

#include <cardtools.h>

Checks if a card comes before another.

Useful for sorting with suit first than rank

Deprecated:
use the compare operators (see Utilities)
Parameters
lhsa card
rhsa card
Returns
true if lhs comes before rhs, false otherwise
std::string NetMauMau::Common::createCardDesc ( NetMauMau::Common::ICard::SUIT  suite,
NetMauMau::Common::ICard::RANK  rank,
bool  ansi 
)

#include <cardtools.h>

Creates a card description.

Parameters
suitethe SUIT
rankthe RANK
ansiif true create a ANSI color representation
Returns
the card description

References NetMauMau::Common::suitToSymbol().

template<typename Tp , typename Iterator >
std::iterator_traits<Iterator>::value_type NetMauMau::Common::find ( Tp  arg,
Iterator  first,
Iterator  last 
)

#include <cardtools.h>

Generic find function.

Search for the first occurrence of a card

Template Parameters
TpNetMauMau::Common::ICard::SUIT, NetMauMau::Common::ICard::RANK or pointer to NetMauMau::Common::ICard type
Iteratoriterator type to a collection of NetMauMau::Common::ICard type pointers
Deprecated:
use the generic NetMauMau::Common::equalTo instead
Parameters
argNetMauMau::Common::ICard::SUIT, NetMauMau::Common::ICard::RANK or pointer to NetMauMau::Common::ICard type
firstiterator to begin of the range to search for
lastiterator to end of the range to search for
Returns
a NetMauMau::Common::ICard type pointer, or NULL if nothing was found
Since
0.21.0

Referenced by NetMauMau::Common::findCard(), NetMauMau::Common::findRank(), and NetMauMau::Common::findSuit().

template<typename Iterator >
std::iterator_traits<Iterator>::value_type NetMauMau::Common::findCard ( typename Iterator::value_type  card,
Iterator  first,
Iterator  last 
)
inline

#include <cardtools.h>

Finds the first card equal to a given card.

Template Parameters
Iteratoran iterator
Deprecated:
use the generic NetMauMau::Common::find instead
Parameters
cardthe card to find
firstiterator to the first card
lastiterator to the last card
Returns
the card if found 0L otherwise

References NetMauMau::Common::find().

template<typename Iterator >
std::iterator_traits<Iterator>::value_type NetMauMau::Common::findRank ( NetMauMau::Common::ICard::RANK  rank,
Iterator  first,
Iterator  last 
)
inline

#include <cardtools.h>

Finds the first card of a given RANK.

Template Parameters
Iteratoran iterator
Deprecated:
use the generic NetMauMau::Common::find instead
Parameters
rankthe RANK to find
firstiterator to the first card
lastiterator to the last card
Returns
the card if found 0L otherwise

References NetMauMau::Common::find().

template<typename Iterator >
std::iterator_traits<Iterator>::value_type NetMauMau::Common::findSuit ( NetMauMau::Common::ICard::SUIT  suit,
Iterator  first,
Iterator  last 
)
inline

#include <cardtools.h>

Finds the first card of a given SUIT.

Template Parameters
Iteratoran iterator
Deprecated:
use the generic NetMauMau::Common::find instead
Parameters
suitthe SUIT to find
firstiterator to the first card
lastiterator to the last card
Returns
the card if found 0L otherwise

References NetMauMau::Common::find().

NetMauMau::Common::CARDCONFIG NetMauMau::Common::getCardConfig ( std::size_t  players,
std::size_t  initialCardCount = 5,
std::size_t  decks = 1 
)

#include <cardtools.h>

Determines reasonable amounts of initial cards and card decks.

This function calculates reasonable values based on the amount of players, initialCardCount and decks.

This function can be used by clients to avoid the server adjusting the given parameters.

Parameters
playersthe amount of players
initialCardCountthe desired amount of initial cards
decksthe desired amount of card decks
See also
CARDCONFIG
Returns
structure containing the reasonable values
Since
0.19.1
std::size_t NetMauMau::Common::getCardPoints ( NetMauMau::Common::ICard::RANK  rank)

#include <cardtools.h>

Gets the points of a RANK.

Rank Points
Seven 1
Eight 2
Nine 3
Ten 4
Queen 5
King 6
Ace 11
Jack 20
See also
Common::ICard::getPoints
Parameters
rankthe RANK
Returns
the points of a RANK
uint32_t AbstractClientV05::getClientLibraryVersion ( )
static

#include <abstractclient.h>

Returns the version of the client library.

Returns
the library version
Since
0.17.0

References MAKE_VERSION_REL.

uint32_t AbstractClientV05::getClientProtocolVersion ( )
static

#include <abstractclient.h>

Returns the version of the client's implemented protocol.

You can retrieve major and minor version as following:

uint16_t major = static_cast<uint16_t>(AbstractClient::getClientProtocolVersion() >> 16);
uint16_t minor = static_cast<uint16_t>(AbstractClient::getClientProtocolVersion());
Returns
the protocol version

References MAKE_VERSION.

const char * AbstractClientV05::getDefaultAIName ( )
static

#include <abstractclient.h>

Gets the compiled in default AI player name.

Returns
the compiled in default AI player name
uint16_t AbstractClientV05::getDefaultPort ( )
static

#include <abstractclient.h>

Gets the default port of the server.

Returns
the default port of the server
NetMauMau::Common::ICard * NetMauMau::Common::getIllegalCard ( )

#include <cardtools.h>

Gets an illegal card card to trigger special actions.

See also
NetMauMau::Client::AbstractClient::playCard()
Returns
an illegal card card
std::string AbstractClientV05::getPlayerName ( ) const

#include <abstractclient.h>

Gets the player's name.

Returns
the player's name
const char * NetMauMau::Common::getServerExe ( )

#include <cardtools.h>

Gets the executable name of the server.

Note
on non-Windows systems it returns the full path to the executable
Returns
the executable name of the server
const std::string * NetMauMau::Common::getSuitSymbols ( )

#include <cardtools.h>

Get an array of the four SUIT symbols.

Returns
the four SUIT symbols
bool AbstractClientV05::isPlayerImageUploadable ( const unsigned char *  pngData,
std::size_t  pngDataLen 
)
static

#include <abstractclient.h>

Checks if an player image is uploadable to the server.

Note
it is possible that the server rejects the image anyway if configured to use a different (smaller) maximum file size than this client
Parameters
pngDatathe image data
pngDataLenlength of the image data
Returns
true if the file will most probably accepted by the server, false otherwise
Since
0.5

Referenced by NetMauMau::Client::AbstractClientV11::isPlayerImageUploadable().

bool AbstractClientV11::isPlayerImageUploadable ( const unsigned char *  pngData,
std::size_t  pngDataLen,
const IBase64 base64 
)
static

#include <abstractclient.h>

Checks if an player image is uploadable to the server.

Note
it is possible that the server rejects the image anyway if configured to use a different (smaller) maximum file size than this client
Parameters
pngDatathe image data
pngDataLenlength of the image data
Returns
true if the file will most probably accepted by the server, false otherwise
Since
0.5
Parameters
base64interface to a custom implementation of IBase64
Deprecated:
use AbstractClientV05::isPlayerImageUploadable(const unsigned char *, std::size_t) instead
Since
0.11

References NetMauMau::Client::AbstractClientV05::isPlayerImageUploadable().

bool NetMauMau::Common::isRank ( const NetMauMau::Common::ICard card,
NetMauMau::Common::ICard::RANK  rank 
)

#include <cardtools.h>

Checks if the a card is of RANK.

Parameters
cardthe card to check
rankthe RANK to check for
Deprecated:
use the generic NetMauMau::Common::equalTo instead
Returns
true if the card is of RANK
bool NetMauMau::Common::isSuit ( const NetMauMau::Common::ICard card,
NetMauMau::Common::ICard::SUIT  suit 
)

#include <cardtools.h>

Checks if the a card is of SUIT.

Parameters
cardthe card to check
suitthe SUIT to check for
Deprecated:
use the generic NetMauMau::Common::equalTo instead
Returns
true if the card is of SUIT
bool operator!= ( const NetMauMau::Common::ICard card,
NetMauMau::Common::ICard::RANK  rank 
)
related

Compares a card against a rank.

Parameters
cardcard to compare to
rankrank to compare to
Returns
false if equal, true otherwise
Since
0.20.2

References NetMauMau::Common::ICard::getRank().

bool operator!= ( const NetMauMau::Common::ICard card,
NetMauMau::Common::ICard::SUIT  suit 
)
related

Compares a card against a suit.

Parameters
cardcard to compare to
suitsuit to compare to
Returns
false if equal, true otherwise
Since
0.20.2

References NetMauMau::Common::ICard::getSuit().

bool operator!= ( const NetMauMau::Common::ICard lhs,
const NetMauMau::Common::ICard rhs 
)
related

Compares cards.

Parameters
lhsleft card
rhsright card
Returns
false if equal, true otherwise
Since
0.20.2
bool operator!= ( const NetMauMau::Common::ICard card,
NetMauMau::Common::ICard::RANK  rank 
)
related

Compares a card against a rank.

Parameters
cardcard to compare to
rankrank to compare to
Returns
false if equal, true otherwise
Since
0.20.2
bool operator!= ( const NetMauMau::Common::ICard card,
NetMauMau::Common::ICard::SUIT  suit 
)
related

Compares a card against a suit.

Parameters
cardcard to compare to
suitsuit to compare to
Returns
false if equal, true otherwise
Since
0.20.2
bool operator< ( const NetMauMau::Common::ICard lhs,
const NetMauMau::Common::ICard rhs 
)
related

Compares cards.

Parameters
lhsleft card
rhsright card
Returns
true if lesser, false otherwise
Since
0.20.2

References NetMauMau::Common::ICard::getRank(), NetMauMau::Common::ICard::getSuit(), NetMauMau::Common::rankOrderPosition(), and NetMauMau::Common::suitOrderPosition().

bool operator== ( const NetMauMau::Common::ICard card,
NetMauMau::Common::ICard::RANK  rank 
)
related

Compares a card against a rank.

Parameters
cardcard to compare to
rankrank to compare to
Returns
true if equal, false otherwise
Since
0.20.2

References NetMauMau::Common::ICard::getRank().

bool operator== ( const NetMauMau::Common::ICard card,
NetMauMau::Common::ICard::SUIT  suit 
)
related

Compares a card against a suit.

Parameters
cardcard to compare to
suitsuit to compare to
Returns
true if equal, false otherwise
Since
0.20.2

References NetMauMau::Common::ICard::getSuit().

bool operator== ( const NetMauMau::Common::ICard lhs,
const NetMauMau::Common::ICard rhs 
)
related

Compares cards.

Parameters
lhsleft card
rhsright card
Returns
true if equal, false otherwise
Since
0.20.2

References NetMauMau::Common::ICard::getRank(), and NetMauMau::Common::ICard::getSuit().

bool operator== ( const NetMauMau::Common::ICard card,
NetMauMau::Common::ICard::RANK  rank 
)
related

Compares a card against a rank.

Parameters
cardcard to compare to
rankrank to compare to
Returns
true if equal, false otherwise
Since
0.20.2
bool operator== ( const NetMauMau::Common::ICard card,
NetMauMau::Common::ICard::SUIT  suit 
)
related

Compares a card against a suit.

Parameters
cardcard to compare to
suitsuit to compare to
Returns
true if equal, false otherwise
Since
0.20.2
bool operator> ( const NetMauMau::Common::ICard lhs,
const NetMauMau::Common::ICard rhs 
)
related

Compares cards.

Parameters
lhsleft card
rhsright card
Returns
true if greater, false otherwise
Since
0.20.2

References NetMauMau::Common::ICard::getRank(), NetMauMau::Common::ICard::getSuit(), NetMauMau::Common::rankOrderPosition(), and NetMauMau::Common::suitOrderPosition().

bool NetMauMau::Common::parseCardDesc ( const std::string &  desc,
NetMauMau::Common::ICard::SUIT suit,
NetMauMau::Common::ICard::RANK rank 
)

#include <cardtools.h>

Parses a textual description.

Parses a textual description and stores the suit and the rank into the pointers, which cannot be null.

Parameters
[in]descthe textual description of the card
[out]suitpointer to store the resulting SUIT
[out]rankpointer to store the resulting RANK
Returns
true if the parsing was successful, false otherwise

References NetMauMau::Common::symbolToSuit().

uint32_t AbstractClientV05::parseProtocolVersion ( const std::string &  version)
static

#include <abstractclient.h>

Parses a version string and returns the resulting protocol version.

Parameters
versionthe protocol version as string
Returns
the protocol version
Since
0.3

References MAKE_VERSION, and MAKE_VERSION_REL.

Connection::PLAYERINFOS AbstractClientV05::playerList ( bool  playerPNG,
timeval *  timeout = NULL 
)
throw (NetMauMau::Common::Exception::SocketException
)

#include <abstractclient.h>

Returns the list of currently registered player names.

Note
The image data returned in NetMauMau::Client::AbstractClient::PLAYERLIST must be freed by the user
delete [] x->pngData
Parameters
playerPNGtrue if the player images should get retrieved
timeoutthe time to wait for a connection, if NULL there will be no timeout
Exceptions
Common::Exception::SocketExceptionif the connection failed
Client::Exception::PlayerlistExceptionif the player list cannot get retrieved
Client::Exception::TimeoutExceptionif the connection attempt timed out
Client::Exception::CapabilitiesExceptionif called within a running game
Returns
the list of currently registered player names
Since
0.4
Connection::PLAYERLIST AbstractClientV05::playerList ( timeval *  timeout = NULL)
throw (NetMauMau::Common::Exception::SocketException
)

#include <abstractclient.h>

Returns the list of currently registered player names.

It does not retrieve the player images

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

unsigned int NetMauMau::Common::rankOrderPosition ( NetMauMau::Common::ICard::RANK  rank)
unsigned int NetMauMau::Common::suitOrderPosition ( NetMauMau::Common::ICard::SUIT  suit)

#include <cardtools.h>

Gets an ordinal number for a SUIT.

The ordinals follow the Skat and Doppelkopf order
See here: http://i-p-c-s.org/faq/suit-ranking.php

Parameters
suitthe SUIT to get the ordinal for
Returns
ordinal number for a SUIT

Referenced by NetMauMau::Common::ICard::operator<(), and NetMauMau::Common::ICard::operator>().

std::string NetMauMau::Common::suitToSymbol ( NetMauMau::Common::ICard::SUIT  suit,
bool  ansi,
bool  endansi = false 
)

#include <cardtools.h>

Converts a NetMauMau::Common::ICard::SUIT to a symbol.

Parameters
suitthe SUIT to convert
ansiif true create a ANSI color representation
endansiif false (default) don't end the ANSI color codes
Returns
the SUIT symbol

Referenced by NetMauMau::Common::ansiSuit(), and NetMauMau::Common::createCardDesc().

NetMauMau::Common::ICard::SUIT NetMauMau::Common::symbolToSuit ( const std::string &  symbol)

#include <cardtools.h>

Converts a symbol to a NetMauMau::Common::ICard::SUIT.

Parameters
symbolthe symbol
Returns
the SUIT

Referenced by NetMauMau::Common::ansiSuit(), and NetMauMau::Common::parseCardDesc().

Variable Documentation

const std::string NetMauMau::Common::DefaultPlayerImage

#include <defaultplayerimage.h>

std::string containing the default player image in PNG format

Since
0.11