AbstractEngine Class Reference

The document/data object for the game. More...

#include <abstractengine.h>

Inheritance diagram for AbstractEngine:

Inheritance graph
[legend]
List of all members.

Public Types

enum  GameStatus { Running, Stopped }
 Stati of the game. More...

Public Slots

virtual void playerInput (int inputId, int playerNumber, int cardNumber)=0
 Player input available.

Signals

void signalGameOver (int winner)
 The game over signal.
void signalNextPlayer (Player *player)
 A players turn is about to start.

Public Member Functions

 AbstractEngine (QWidget *parent)
 Constructor for the game engine.
virtual void startGame (Suite trump, int startPlayer)=0
 Start a new game.
virtual void stopGame ()=0
 Stop a game.
virtual bool isGameRunning ()
 Is the game still running?
virtual void addPlayer (int no, Player *player)
 Add a player to the game.
virtual Playerplayer (int no)
 Retreive the player of the given number.
virtual int currentPlayer ()
 Retrieve the current player id.

Protected Attributes

GameStatus mGameStatus
 Current game status.
int mCurrentPlayer
 Whose turn is it.
QHash< int, Player * > mPlayers
 Player in the game.

Detailed Description

The document/data object for the game.

Definition at line 41 of file abstractengine.h.


Member Enumeration Documentation

enum AbstractEngine::GameStatus
 

Stati of the game.

Enumerator:
Running 
Stopped 

Definition at line 52 of file abstractengine.h.


Constructor & Destructor Documentation

AbstractEngine::AbstractEngine QWidget *  parent  ) 
 

Constructor for the game engine.

Parameters:
parent The parent window

Definition at line 31 of file abstractengine.cpp.

References mGameStatus, mPlayers, and Stopped.


Member Function Documentation

void AbstractEngine::addPlayer int  no,
Player player
[virtual]
 

Add a player to the game.

Parameters:
no Player number
player Player to add

Definition at line 40 of file abstractengine.cpp.

References mPlayers, and player().

Referenced by Mainwindow::menuNewLSkatGame().

Here is the call graph for this function:

virtual int AbstractEngine::currentPlayer  )  [inline, virtual]
 

Retrieve the current player id.

Returns:
The current player.

Definition at line 84 of file abstractengine.h.

References mCurrentPlayer.

Referenced by AiInput::aiTurn().

virtual bool AbstractEngine::isGameRunning  )  [inline, virtual]
 

Is the game still running?

Returns:
True if the game is running.

Definition at line 67 of file abstractengine.h.

References mGameStatus, and Running.

Referenced by EngineTwo::gameLoopFinish(), EngineTwo::gameLoopStart(), and Mainwindow::setInputType().

Player * AbstractEngine::player int  no  )  [virtual]
 

Retreive the player of the given number.

Parameters:
no The player number.
Returns:
The player.

Definition at line 47 of file abstractengine.cpp.

References mPlayers.

Referenced by addPlayer(), EngineTwo::gameLoopFinish(), AiInput::getBoardFromEngine(), EngineTwo::isLegalMove(), EngineTwo::playerInput(), and EngineTwo::startGame().

virtual void AbstractEngine::playerInput int  inputId,
int  playerNumber,
int  cardNumber
[pure virtual, slot]
 

Player input available.

Parameters:
inputId The input device id
playerNumber The player number [0-1]
cardNumber The card number [0-7]

Implemented in EngineTwo.

void AbstractEngine::signalGameOver int  winner  )  [signal]
 

The game over signal.

Parameters:
winner The game winner (0,1,-1:drawn, -2:abort)

Referenced by EngineTwo::gameLoopFinish().

void AbstractEngine::signalNextPlayer Player player  )  [signal]
 

A players turn is about to start.

Parameters:
player The new player

virtual void AbstractEngine::startGame Suite  trump,
int  startPlayer
[pure virtual]
 

Start a new game.

Parameters:
trump The trump suite.
startPlayer The start player

Implemented in EngineTwo.

virtual void AbstractEngine::stopGame  )  [pure virtual]
 

Stop a game.

Implemented in EngineTwo.

Referenced by Mainwindow::menuEndGame(), Mainwindow::menuNewLSkatGame(), and Mainwindow::queryExit().


Member Data Documentation

int AbstractEngine::mCurrentPlayer [protected]
 

Whose turn is it.

Definition at line 110 of file abstractengine.h.

Referenced by currentPlayer(), EngineTwo::EngineTwo(), EngineTwo::gameLoopFinish(), EngineTwo::gameLoopStart(), EngineTwo::playerInput(), and EngineTwo::startGame().

GameStatus AbstractEngine::mGameStatus [protected]
 

Current game status.

Definition at line 108 of file abstractengine.h.

Referenced by AbstractEngine(), EngineTwo::gameLoopFinish(), isGameRunning(), and EngineTwo::startGame().

QHash<int, Player*> AbstractEngine::mPlayers [protected]
 

Player in the game.

Definition at line 113 of file abstractengine.h.

Referenced by AbstractEngine(), EngineTwo::activatePlayer(), addPlayer(), EngineTwo::evaluateGame(), EngineTwo::gameLoopFinish(), player(), EngineTwo::playerInput(), EngineTwo::startGame(), and EngineTwo::stopGame().


The documentation for this class was generated from the following files:
Generated on Tue May 1 09:34:40 2007 for LSkat by  doxygen 1.4.6