Cute Chess  0.1
Public Member Functions | List of all members
PlayerBuilder Class Referenceabstract

A class for constructing new chess players. More...

#include <playerbuilder.h>

Inheritance diagram for PlayerBuilder:
EngineBuilder HumanBuilder

Public Member Functions

virtual ChessPlayercreate (QObject *receiver, const char *method, QObject *parent, QString *error) const =0
 
virtual bool isHuman () const =0
 
QString name () const
 
 PlayerBuilder (const QString &name)
 
void setName (const QString &name)
 
virtual ~PlayerBuilder ()
 

Detailed Description

A class for constructing new chess players.

PlayerBuilder's subclasses can create all types of chess players. This class enables a GameManager object to take control of constructing, reusing and deleting players, and running multiple games concurrently, which requires multiple instances of the same players.

See also
GameManager

Constructor & Destructor Documentation

PlayerBuilder::PlayerBuilder ( const QString name)

Creates a new player builder with name name.

PlayerBuilder::~PlayerBuilder ( )
virtual

Destroys the player builder.

Member Function Documentation

virtual ChessPlayer* PlayerBuilder::create ( QObject receiver,
const char *  method,
QObject parent,
QString error 
) const
pure virtual

Creates a new player and sets its parent to parent.

Parameters
receiverThe receiver of the player's debugging messages.
methodThe receiver's method the debugMessage(QString) signal will connect to.
parentThe player's parent object.
errorIf an error occurs and error is not 0, the error description is written here.

Implemented in HumanBuilder, and EngineBuilder.

virtual bool PlayerBuilder::isHuman ( ) const
pure virtual

Returns true if the builder is for a human player; otherwise returns false.

Implemented in HumanBuilder, and EngineBuilder.

QString PlayerBuilder::name ( ) const

Returns the player's name.

void PlayerBuilder::setName ( const QString name)

Sets the player's name to name.


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