GameInformation Class Reference

#include <gameinformation.h>

Collaboration diagram for GameInformation:

Collaboration graph
[legend]

List of all members.


Detailed Description

This holds game specific state information for a player.

Author:
John Schneiderman

Public Member Functions

void add (const QString &key, const QString &value)
void add (const QString &key, double value)
void add (const QString &key, int value)
void clear ()
 GameInformation ()
QString value (const QString &key) const
 ~GameInformation ()

Friends

QTextStream & operator<< (QTextStream &out, const GameInformation &gameInformation)
ostream & operator<< (ostream &out, const GameInformation &gameInformation)
QTextStream & operator>> (QTextStream &in, GameInformation &gameInformation)

Constructor & Destructor Documentation

GameInformation::GameInformation (  ) 

General constructor.

GameInformation::~GameInformation (  ) 

General destructor.


Member Function Documentation

void GameInformation::add ( const QString &  key,
const QString &  value 
)

Adds a key-value pair into the game state information. If the key is already present, then the value is updated.

Parameters:
key is the key for the game state information, generally a description of the value.
value is the information to store for the game state information.
Exceptions:
KardsGTError if key or value has a "_" or a "~" in them.

void GameInformation::add ( const QString &  key,
double  value 
)

Adds a key-value pair into the game state information. If the key is already present, then the value is updated.

Parameters:
key is the key for the game state information, generally a description of the value.
value is the information to store for the game state information.
Exceptions:
KardsGTError if key has a "_" or a "~" in it.

void GameInformation::add ( const QString &  key,
int  value 
)

Adds a key-value pair into the game state information. If the key is already present, then the value is updated.

Parameters:
key is the key for the game state information, generally a description of the value.
value is the information to store for the game state information.
Exceptions:
KardsGTError if key has a "_" or a "~" in it.

void GameInformation::clear (  ) 

Clears the contents of the Game Information.

QString GameInformation::value ( const QString &  key  )  const

Retrieves the value for a specific key.

Parameters:
key is the key for the game state value we want to know.
Returns:
the value found for the key, if the key is not found an empty string is returned.


Friends And Related Function Documentation

QTextStream& operator<< ( QTextStream &  out,
const GameInformation gameInformation 
) [friend]

Stream insertion operator.

Parameters:
out is the stream to get the game information from.
gameInformation is the game information object to put the information into.
Returns:
out.

ostream& operator<< ( ostream &  out,
const GameInformation gameInformation 
) [friend]

Stream insertion operator.

Parameters:
out is the stream to get the game information from.
gameInformation is the game information object to put the information into.
Returns:
out.

QTextStream& operator>> ( QTextStream &  in,
GameInformation gameInformation 
) [friend]

Stream extraction operator.

Parameters:
in is the stream to put the game information into.
gameInformation is the game information object to get the information from.
Returns:
in.


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

Generated on Tue Aug 12 23:24:01 2008 for KardsGT by  doxygen 1.5.5