PlayerFactory Class Reference
#include <playerfactory.h>
List of all members.
Detailed Description
This creates any player known to the card game, and tracks them.
- Author:
- John Schneiderman
Constructor & Destructor Documentation
PlayerFactory::PlayerFactory |
( |
|
) |
|
PlayerFactory::~PlayerFactory |
( |
|
) |
|
Default destructor.
- Note:
- we don't need to free our m_ais because the freeing of m_players in GameBase takes care of it.
Member Function Documentation
void PlayerFactory::clear |
( |
|
) |
|
Clears and frees the list of computer players.
bool PlayerFactory::createPlayer |
( |
const QString & |
playersName, |
|
|
const QString & |
game | |
|
) |
| | |
Creates a computer player.
- Parameters:
-
| playersName | is the name of the computer player we want to create. |
- Note:
- The name of the player must be an AI player that already exists!
- Parameters:
-
| game | is the name of the game the player will be playing. |
- Returns:
- true if the computer player was created, false if not.
vector< QString > PlayerFactory::playerNames |
( |
|
) |
const |
Lists the names of all the players known to the factory.
- Note:
- the names are based on the player sentinels.
- Returns:
- an array filled with the names of the players.
An accessor to the current players.
- Returns:
- the current player listings.
An accessor to the current players.
- Returns:
- the current player listings.
bool PlayerFactory::setupAIBase |
( |
const QString & |
playersName |
) |
[protected] |
This sets up the AI for the computer player.
- Parameters:
-
| playersName | is the name of the player we want to create based on our AI listings. |
- Returns:
- true if the AI component was successfully created, false elsewise.
bool PlayerFactory::setupGamePlayer |
( |
const QString & |
game |
) |
[protected] |
This sets up the computer player.
- Parameters:
-
| game | is the name of the game we want the computer player to play. |
- Returns:
- true if the computer player was successfully create, false elsewise.
The documentation for this class was generated from the following files:
- playerfactory.h
- playerfactory.cpp