AiInput Class Reference

AI input device. More...

#include <aiinput.h>

Inheritance diagram for AiInput:

Inheritance graph
[legend]
Collaboration diagram for AiInput:

Collaboration graph
[legend]
List of all members.

Public Slots

void aiTurn ()
 AI turn is performed.

Public Member Functions

 AiInput (EngineTwo *engine, QObject *parent)
 Constructor for the input.
void setInputAllowed (bool allowed)
 Allow or disallow input with this device.
virtual InputDevice::InputDeviceType type ()
 Retrieve the type of device.

Protected Member Functions

Board getBoardFromEngine ()
 Extract the current game board from the engine.
Move initiateMove (int p, const Board &board)
 Initiate a new move as first player.
Move answerMove (int p, const Board &board)
 Answer a move as second player.
double evaluteGame (int p, const AiInput::Board current)
 Evaluate the current game board and return a rating.

Classes

class  Board
 AI storage of the game board.
class  Move
 AI representation of a move.

Detailed Description

AI input device.

Definition at line 34 of file aiinput.h.


Constructor & Destructor Documentation

AiInput::AiInput EngineTwo engine,
QObject *  parent
 

Constructor for the input.

Parameters:
engine The game engine
parent The parent object

Definition at line 36 of file aiinput.cpp.


Member Function Documentation

void AiInput::aiTurn  )  [slot]
 

AI turn is performed.

Definition at line 53 of file aiinput.cpp.

References AbstractEngine::currentPlayer(), global_debug, AbstractInput::mId, and AbstractInput::mInputAllowed.

Referenced by setInputAllowed().

AiInput::Move AiInput::answerMove int  p,
const Board &  board
[protected]
 

Answer a move as second player.

Parameters:
p The current player number.
board The current game board.
Returns:
The best move.

Definition at line 181 of file aiinput.cpp.

References RATING_SCHWARZ.

double AiInput::evaluteGame int  p,
const AiInput::Board  current
[protected]
 

Evaluate the current game board and return a rating.

Parameters:
p The current player (we)
current The current game board
Returns:
The rating for this situation.

Definition at line 122 of file aiinput.cpp.

References RATING_ONE_POINT, RATING_REMIS, RATING_SCHNEIDER, RATING_SCHWARZ, and RATING_WON.

AiInput::Board AiInput::getBoardFromEngine  )  [protected]
 

Extract the current game board from the engine.

Returns:
The game board.

Definition at line 94 of file aiinput.cpp.

References Player::getCard(), and AbstractEngine::player().

Here is the call graph for this function:

AiInput::Move AiInput::initiateMove int  p,
const Board &  board
[protected]
 

Initiate a new move as first player.

Parameters:
p The current player number.
board The current game board.
Returns:
The best move.

Definition at line 143 of file aiinput.cpp.

References RATING_SCHWARZ.

void AiInput::setInputAllowed bool  allowed  )  [virtual]
 

Allow or disallow input with this device.

Parameters:
allowed True if input is allowed

Reimplemented from AbstractInput.

Definition at line 45 of file aiinput.cpp.

References aiTurn(), and AbstractInput::setInputAllowed().

Here is the call graph for this function:

virtual InputDevice::InputDeviceType AiInput::type  )  [inline, virtual]
 

Retrieve the type of device.

Returns:
The decice type.

Implements AbstractInput.

Definition at line 53 of file aiinput.h.

References InputDevice::TypeAiInput.


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