Static Public Member Functions | Static Public Attributes

GameFactory Class Reference

Constructs a new game following settings. More...

#include <GameFactory.hpp>

List of all members.

Static Public Member Functions

static int getNbControlersNeeded (int gameType)
static AbstractGamecreateGame (int gameType, const std::vector< int > &controlerTypes)

Static Public Attributes

static const int GT_Chess = 0
static const int CT_GNUChess = 0
static const int CT_Player = 1

Detailed Description

Constructs a new game following settings.

The factory brings ID to recognise the game type (GT_*) et the controlers type (CT_*) From these ids, we can construct the corresponding game, which will be returned as an AbstractGame.


Member Function Documentation

AbstractGame * GameFactory::createGame ( int  gameType,
const std::vector< int > &  controlerTypes 
) [static]

Create a new game

Parameters:
gameType the type of the game to create
controlerTypes list of controler ids to put in the game
Returns:
the game as an AbstractGame
Warning:
the pointer returned should be free
Todo:
the pointer can be replaced by a smart pointer
int GameFactory::getNbControlersNeeded ( int  gameType  )  [static]

Gets the number of controlers allowed by the game corresponding to gameType

Parameters:
gameType the type of the game to check
Returns:
number of controlers

Member Data Documentation

const int GameFactory::CT_GNUChess = 0 [static]

ID for controler played by gnuchess

const int GameFactory::CT_Player = 1 [static]

player input

const int GameFactory::GT_Chess = 0 [static]

Chess game


The documentation for this class was generated from the following files:
 All Classes Functions Variables