Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MoveEngine Class Reference

#include </home/clem/local/src/opie/noncore/games/backgammon/moveengine.h>

Collaboration diagram for MoveEngine:

Collaboration graph
[legend]
List of all members.

Signals

void done_dice1 ()
void done_dice2 ()
void done_dice3 ()
void done_dice4 ()
void nomove ()
void player_finished (int)

Public Member Functions

 MoveEngine ()
 ~MoveEngine ()
void position (Pieces &pieces, bool non_qte=false)
void diceroll (const int &player, const int &face1, const int &face2, const int &face3, const int &face4, bool computer)
void boardpressed (const int &x, const int &y, Marker &marker, bool non_qte=false)
void reset ()
void loadGame (const LoadSave &load)
LoadSave saveGame ()
AISettings getAISettings ()
void setAISettings (const AISettings &new_ai)
void setRules (Rules rules)

Private Slots

void automove ()

Private Member Functions

int getPossibleMoves ()
void move (const int &from, int to, const int &dice)
void checkstate ()
void nomarker (Marker &marker)
int fieldColor (const int &index) const

Private Attributes

int x_coord [26]
int yup_coord [15]
int ylow_coord [15]
int z_coord [15]
int x_fin1 [3]
int x_fin2 [3]
int y_fin [5]
int z_fin
Population population [28]
AISettings ai
int player
int otherplayer
int dice [4]
int marker_current
int marker_next [4]
bool allclear [3]
bool pieces_out [3]
bool move_with_pieces_out
bool nice_dice
int last_piece [3]
Possiblilites moves [26]

Constructor & Destructor Documentation

MoveEngine::MoveEngine  ) 
 

Definition at line 6 of file moveengine.cpp.

References reset(), x_coord, x_fin1, x_fin2, y_fin, ylow_coord, yup_coord, z_coord, and z_fin.

MoveEngine::~MoveEngine  ) 
 

Definition at line 39 of file moveengine.cpp.


Member Function Documentation

void MoveEngine::automove  )  [private, slot]
 

Definition at line 165 of file moveengine.cpp.

References move(), moves, player, Possiblilites::to, and Possiblilites::weight.

Referenced by diceroll().

void MoveEngine::boardpressed const int &  x,
const int &  y,
Marker marker,
bool  non_qte = false
 

Definition at line 192 of file moveengine.cpp.

References dice, fieldColor(), marker_current, marker_next, move(), moves, nomarker(), player, Possiblilites::to, upper(), Marker::visible_current, Marker::visible_next, Possiblilites::weight, x_coord, Marker::x_current, Marker::x_next, Marker::y_current, and Marker::y_next.

Referenced by BackGammon::mouse().

void MoveEngine::checkstate  )  [private]
 

Definition at line 503 of file moveengine.cpp.

References allclear, last_piece, pieces_out, population, and Population::total.

Referenced by diceroll(), and loadGame().

void MoveEngine::diceroll const int &  player,
const int &  face1,
const int &  face2,
const int &  face3,
const int &  face4,
bool  computer
 

Definition at line 143 of file moveengine.cpp.

References automove(), checkstate(), dice, getPossibleMoves(), marker_current, nomove(), otherplayer, and player.

Referenced by BackGammon::done_dice1(), BackGammon::done_dice2(), BackGammon::done_dice3(), BackGammon::done_dice4(), and BackGammon::mouse().

void MoveEngine::done_dice1  )  [signal]
 

Referenced by move().

void MoveEngine::done_dice2  )  [signal]
 

Referenced by move().

void MoveEngine::done_dice3  )  [signal]
 

Referenced by move().

void MoveEngine::done_dice4  )  [signal]
 

Referenced by move().

int MoveEngine::fieldColor const int &  index  )  const [private]
 

Definition at line 547 of file moveengine.cpp.

References population, and Population::total.

Referenced by boardpressed(), getPossibleMoves(), and move().

AISettings MoveEngine::getAISettings  ) 
 

Definition at line 348 of file moveengine.cpp.

References ai.

Referenced by BackGammon::modify_AI().

int MoveEngine::getPossibleMoves  )  [private]
 

Definition at line 365 of file moveengine.cpp.

References abs, ai, allclear, dice, AISettings::eliminate, AISettings::empty, AISettings::expose, fieldColor(), last_piece, move_with_pieces_out, moves, nice_dice, otherplayer, pieces_out, player, population, AISettings::protect, AISettings::rescue, AISettings::safe, Possiblilites::to, Population::total, and Possiblilites::weight.

Referenced by diceroll().

void MoveEngine::loadGame const LoadSave load  ) 
 

Definition at line 329 of file moveengine.cpp.

References checkstate(), LoadSave::pop, population, and Population::total.

Referenced by BackGammon::loadgame().

void MoveEngine::move const int &  from,
int  to,
const int &  dice
[private]
 

Definition at line 458 of file moveengine.cpp.

References abs, done_dice1(), done_dice2(), done_dice3(), done_dice4(), fieldColor(), otherplayer, player, player_finished(), population, and Population::total.

Referenced by automove(), and boardpressed().

void MoveEngine::nomarker Marker marker  )  [private]
 

Definition at line 534 of file moveengine.cpp.

References marker_current, marker_next, Marker::visible_current, Marker::visible_next, Marker::x_next, and Marker::y_next.

Referenced by boardpressed().

void MoveEngine::nomove  )  [signal]
 

Referenced by diceroll().

void MoveEngine::player_finished int   )  [signal]
 

Referenced by move().

void MoveEngine::position Pieces pieces,
bool  non_qte = false
 

Definition at line 42 of file moveengine.cpp.

References abs, Pieces::player1, Pieces::player2, population, Coord::side, Population::total, Coord::x, x_coord, x_fin1, x_fin2, Coord::y, y_fin, ylow_coord, yup_coord, Coord::z, z_coord, and z_fin.

Referenced by BackGammon::draw().

void MoveEngine::reset  ) 
 

Definition at line 293 of file moveengine.cpp.

References allclear, dice, last_piece, marker_current, marker_next, player, population, and Population::total.

Referenced by MoveEngine(), and BackGammon::newgame().

LoadSave MoveEngine::saveGame  ) 
 

Definition at line 338 of file moveengine.cpp.

References LoadSave::pop, population, save(), and Population::total.

Referenced by BackGammon::savegame().

void MoveEngine::setAISettings const AISettings new_ai  ) 
 

Definition at line 353 of file moveengine.cpp.

References ai.

Referenced by BackGammon::BackGammon(), and BackGammon::modify_AI().

void MoveEngine::setRules Rules  rules  ) 
 

Definition at line 358 of file moveengine.cpp.

References Rules::generous_dice, Rules::move_with_pieces_out, move_with_pieces_out, and nice_dice.

Referenced by BackGammon::BackGammon(), and BackGammon::setrules().


Member Data Documentation

AISettings MoveEngine::ai [private]
 

Definition at line 27 of file moveengine.h.

Referenced by getAISettings(), getPossibleMoves(), and setAISettings().

bool MoveEngine::allclear[3] [private]
 

Definition at line 36 of file moveengine.h.

Referenced by checkstate(), getPossibleMoves(), and reset().

int MoveEngine::dice[4] [private]
 

Definition at line 31 of file moveengine.h.

Referenced by boardpressed(), diceroll(), getPossibleMoves(), and reset().

int MoveEngine::last_piece[3] [private]
 

Definition at line 42 of file moveengine.h.

Referenced by checkstate(), getPossibleMoves(), and reset().

int MoveEngine::marker_current [private]
 

Definition at line 33 of file moveengine.h.

Referenced by boardpressed(), diceroll(), nomarker(), and reset().

int MoveEngine::marker_next[4] [private]
 

Definition at line 34 of file moveengine.h.

Referenced by boardpressed(), nomarker(), and reset().

bool MoveEngine::move_with_pieces_out [private]
 

Definition at line 39 of file moveengine.h.

Referenced by getPossibleMoves(), and setRules().

Possiblilites MoveEngine::moves[26] [private]
 

Definition at line 44 of file moveengine.h.

Referenced by automove(), boardpressed(), and getPossibleMoves().

bool MoveEngine::nice_dice [private]
 

Definition at line 41 of file moveengine.h.

Referenced by getPossibleMoves(), and setRules().

int MoveEngine::otherplayer [private]
 

Definition at line 30 of file moveengine.h.

Referenced by diceroll(), getPossibleMoves(), and move().

bool MoveEngine::pieces_out[3] [private]
 

Definition at line 38 of file moveengine.h.

Referenced by checkstate(), and getPossibleMoves().

int MoveEngine::player [private]
 

Definition at line 29 of file moveengine.h.

Referenced by automove(), boardpressed(), diceroll(), getPossibleMoves(), move(), and reset().

Population MoveEngine::population[28] [private]
 

Definition at line 26 of file moveengine.h.

Referenced by checkstate(), fieldColor(), getPossibleMoves(), loadGame(), move(), position(), reset(), and saveGame().

int MoveEngine::x_coord[26] [private]
 

Definition at line 9 of file moveengine.h.

Referenced by boardpressed(), MoveEngine(), and position().

int MoveEngine::x_fin1[3] [private]
 

Definition at line 17 of file moveengine.h.

Referenced by MoveEngine(), and position().

int MoveEngine::x_fin2[3] [private]
 

Definition at line 18 of file moveengine.h.

Referenced by MoveEngine(), and position().

int MoveEngine::y_fin[5] [private]
 

Definition at line 19 of file moveengine.h.

Referenced by MoveEngine(), and position().

int MoveEngine::ylow_coord[15] [private]
 

Definition at line 14 of file moveengine.h.

Referenced by MoveEngine(), and position().

int MoveEngine::yup_coord[15] [private]
 

Definition at line 13 of file moveengine.h.

Referenced by MoveEngine(), and position().

int MoveEngine::z_coord[15] [private]
 

Definition at line 15 of file moveengine.h.

Referenced by MoveEngine(), and position().

int MoveEngine::z_fin [private]
 

Definition at line 20 of file moveengine.h.

Referenced by MoveEngine(), and position().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:40:44 2005 for OPIE by  doxygen 1.4.2