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

BackGammon Class Reference

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

Collaboration diagram for BackGammon:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BackGammon (QWidget *parent=0, const char *name=0, WFlags fl=0)
 ~BackGammon ()

Static Public Member Functions

static QString appName ()

Private Slots

void newgame ()
void playerselect ()
void loadgame ()
void savegame ()
void deletegame ()
void newtheme ()
void loadtheme ()
void savetheme ()
void themedefault ()
void deletetheme ()
void modify_AI ()
void setrules ()
void mouse (int x, int y)
void done_dice1 ()
void done_dice2 ()
void done_dice3 ()
void done_dice4 ()
void nomove ()
void nomove2 ()
void finished (int theplayer)
void autoroll_dice1 ()
void autoroll_dice2 ()

Private Member Functions

void draw ()
void showdice ()
void setplayer ()
void applytheme ()

Private Attributes

QLabel * message
QCanvas * area
BackGammonViewboardview
CanvasImageItemboard
CanvasImageItemtable
CanvasImageItem ** p1
CanvasImageItem ** p2
CanvasImageItem ** p1_side
CanvasImageItem ** p2_side
CanvasImageItem ** diceA1
CanvasImageItem ** diceA2
CanvasImageItem ** diceB1
CanvasImageItem ** diceB2
CanvasImageItemnomove_marker
QCanvasRectangle * marker_current
QCanvasRectangle * marker_next [4]
MoveEnginemove
int diceA1_value
int diceA2_value
int diceA3_value
int diceA4_value
int diceB1_value
int diceB2_value
int diceB3_value
int diceB4_value
int player
bool dice1_played
bool dice2_played
bool dice3_played
bool dice4_played
bool dice_rolled
bool player1_auto
bool player2_auto
QString theme_name
QString board_name
QString piecesA_name
QString piecesB_name
QString diceA_name
QString diceB_name
QString odds_name
QString table_name
QString game_name
Rules rules
Display display
bool gameFinished

Constructor & Destructor Documentation

BackGammon::BackGammon QWidget *  parent = 0,
const char *  name = 0,
WFlags  fl = 0
 

Definition at line 25 of file backgammon.cpp.

References area, board, board_name, boardview, deletegame(), deletetheme(), diceA1, diceA2, diceA_name, diceB1, diceB2, diceB_name, done_dice1(), done_dice2(), done_dice3(), done_dice4(), draw(), AISettings::eliminate, AISettings::empty, AISettings::expose, Config::File, finished(), Rules::generous_dice, Config::isValid(), loadgame(), Opie::Core::OResource::loadImage(), Opie::Core::OResource::loadPixmap(), loadtheme(), marker_current, marker_next, message, modify_AI(), mouse(), move, Rules::move_with_pieces_out, newgame(), newtheme(), nomove(), nomove_marker, odds_name, odebug, oendl, p1, p1_side, p2, p2_side, piecesA_name, piecesB_name, player1_auto, player2_auto, playerselect(), AISettings::protect, QPEApplication::qpeDir(), Config::readBoolEntry(), Config::readEntry(), Config::readNumEntry(), AISettings::rescue, rules, AISettings::safe, savegame(), savetheme(), MoveEngine::setAISettings(), Config::setGroup(), setrules(), MoveEngine::setRules(), table, table_name, theme_name, themedefault(), Dasher::Opts::TopToBottom, tr, and Config::writeEntry().

BackGammon::~BackGammon  ) 
 

Definition at line 282 of file backgammon.cpp.


Member Function Documentation

void BackGammon::applytheme  )  [private]
 

Definition at line 925 of file backgammon.cpp.

References board, board_name, diceA1, diceA2, diceA_name, diceB1, diceB2, diceB_name, draw(), Opie::Core::OResource::loadImage(), odds_name, p1, p1_side, p2, p2_side, piecesA_name, piecesB_name, CanvasImageItem::setImage(), table, and table_name.

Referenced by loadtheme(), and newtheme().

static QString BackGammon::appName  )  [inline, static]
 

Definition at line 88 of file backgammon.h.

References QString::fromLatin1().

void BackGammon::autoroll_dice1  )  [private, slot]
 

Definition at line 915 of file backgammon.cpp.

References mouse().

Referenced by setplayer().

void BackGammon::autoroll_dice2  )  [private, slot]
 

Definition at line 920 of file backgammon.cpp.

References mouse().

Referenced by setplayer().

void BackGammon::deletegame  )  [private, slot]
 

Definition at line 402 of file backgammon.cpp.

References FileDialog::filename(), game_name, QPEApplication::qpeDir(), and warning().

Referenced by BackGammon().

void BackGammon::deletetheme  )  [private, slot]
 

Definition at line 505 of file backgammon.cpp.

References FileDialog::filename(), QPEApplication::qpeDir(), theme_name, tr, and warning().

Referenced by BackGammon().

void BackGammon::done_dice1  )  [private, slot]
 

Definition at line 697 of file backgammon.cpp.

References area, dice1_played, dice2_played, dice3_played, dice4_played, diceA1_value, diceA2_value, diceA3_value, diceA4_value, diceB1_value, diceB2_value, diceB3_value, diceB4_value, MoveEngine::diceroll(), draw(), move, player, player1_auto, player2_auto, setplayer(), and showdice().

Referenced by BackGammon().

void BackGammon::done_dice2  )  [private, slot]
 

Definition at line 721 of file backgammon.cpp.

References area, dice1_played, dice2_played, dice3_played, dice4_played, diceA1_value, diceA2_value, diceA3_value, diceA4_value, diceB1_value, diceB2_value, diceB3_value, diceB4_value, MoveEngine::diceroll(), draw(), move, player, player1_auto, player2_auto, setplayer(), and showdice().

Referenced by BackGammon().

void BackGammon::done_dice3  )  [private, slot]
 

Definition at line 746 of file backgammon.cpp.

References area, dice1_played, dice2_played, dice3_played, dice4_played, diceA1_value, diceA2_value, diceA3_value, diceA4_value, diceB1_value, diceB2_value, diceB3_value, diceB4_value, MoveEngine::diceroll(), draw(), move, player, player1_auto, player2_auto, setplayer(), and showdice().

Referenced by BackGammon().

void BackGammon::done_dice4  )  [private, slot]
 

Definition at line 771 of file backgammon.cpp.

References area, dice1_played, dice2_played, dice3_played, dice4_played, diceA1_value, diceA2_value, diceA3_value, diceA4_value, diceB1_value, diceB2_value, diceB3_value, diceB4_value, MoveEngine::diceroll(), draw(), move, player, player1_auto, player2_auto, setplayer(), and showdice().

Referenced by BackGammon().

void BackGammon::draw  )  [private]
 

Definition at line 556 of file backgammon.cpp.

References move, p1, p1_side, p2, p2_side, Pieces::player1, Pieces::player2, MoveEngine::position(), Coord::side, Coord::x, Coord::y, and Coord::z.

Referenced by applytheme(), BackGammon(), done_dice1(), done_dice2(), done_dice3(), done_dice4(), finished(), loadgame(), newgame(), and nomove2().

void BackGammon::finished int  theplayer  )  [private, slot]
 

Definition at line 835 of file backgammon.cpp.

References area, diceA1_value, diceA2_value, diceB1_value, diceB2_value, draw(), gameFinished, message, nomove_marker, player, showdice(), and tr.

Referenced by BackGammon().

void BackGammon::loadgame  )  [private, slot]
 

Definition at line 324 of file backgammon.cpp.

References area, dice1_played, dice2_played, dice3_played, dice4_played, dice_rolled, diceA1_value, diceA2_value, diceA3_value, diceA4_value, diceB1_value, diceB2_value, diceB3_value, diceB4_value, draw(), Config::File, FileDialog::filename(), game, game_name, MoveEngine::loadGame(), move, player, player1_auto, LoadSave::pop, QPEApplication::qpeDir(), Config::readBoolEntry(), Config::readNumEntry(), Config::setGroup(), QString::setNum(), setplayer(), showdice(), and Population::total.

Referenced by BackGammon().

void BackGammon::loadtheme  )  [private, slot]
 

Definition at line 449 of file backgammon.cpp.

References applytheme(), board_name, diceA_name, diceB_name, Config::File, FileDialog::filename(), odds_name, piecesA_name, piecesB_name, QPEApplication::qpeDir(), Config::readEntry(), Config::setGroup(), table_name, and theme_name.

Referenced by BackGammon().

void BackGammon::modify_AI  )  [private, slot]
 

Definition at line 520 of file backgammon.cpp.

References AISettings::eliminate, AISettings::empty, AISettings::expose, AI_Dialog::getAISettings(), MoveEngine::getAISettings(), move, AISettings::protect, AISettings::rescue, AISettings::safe, MoveEngine::setAISettings(), AI_Dialog::setAISettings(), Config::setGroup(), tr, and Config::writeEntry().

Referenced by BackGammon().

void BackGammon::mouse int  x,
int  y
[private, slot]
 

Definition at line 598 of file backgammon.cpp.

References area, MoveEngine::boardpressed(), QTime::currentTime(), dice1_played, dice2_played, dice3_played, dice4_played, dice_rolled, diceA1_value, diceA2_value, diceA3_value, diceA4_value, diceB1_value, diceB2_value, diceB3_value, diceB4_value, MoveEngine::diceroll(), gameFinished, marker, marker_current, marker_next, move, newgame(), player, player1_auto, player2_auto, showdice(), Marker::visible_current, Marker::visible_next, Marker::x_current, Marker::x_next, Marker::y_current, and Marker::y_next.

Referenced by autoroll_dice1(), autoroll_dice2(), and BackGammon().

void BackGammon::newgame  )  [private, slot]
 

Definition at line 287 of file backgammon.cpp.

References area, QDateTime::currentDateTime(), QDateTime::date(), dice1_played, dice2_played, dice3_played, dice4_played, dice_rolled, diceA1_value, diceA2_value, diceA3_value, diceA4_value, diceB1_value, diceB2_value, diceB3_value, diceB4_value, draw(), game_name, gameFinished, move, player, MoveEngine::reset(), setplayer(), showdice(), and QDateTime::time().

Referenced by BackGammon(), and mouse().

void BackGammon::newtheme  )  [private, slot]
 

Definition at line 418 of file backgammon.cpp.

References applytheme(), ImageNames::board, board_name, ImageNames::dice1, ImageNames::dice2, diceA_name, diceB_name, ThemeDialog::getNames(), ImageNames::odds, odds_name, ImageNames::pieces1, ImageNames::pieces2, piecesA_name, piecesB_name, ThemeDialog::setCurrent(), ImageNames::table, table_name, ImageNames::theme, and theme_name.

Referenced by BackGammon().

void BackGammon::nomove  )  [private, slot]
 

Definition at line 796 of file backgammon.cpp.

References area, dice1_played, dice2_played, dice3_played, dice4_played, diceA1_value, diceA2_value, diceA3_value, diceA4_value, diceB1_value, diceB2_value, diceB3_value, diceB4_value, message, nomove2(), nomove_marker, player, and tr.

Referenced by BackGammon().

void BackGammon::nomove2  )  [private, slot]
 

Definition at line 826 of file backgammon.cpp.

References area, draw(), nomove_marker, setplayer(), and showdice().

Referenced by nomove().

void BackGammon::playerselect  )  [private, slot]
 

Definition at line 313 of file backgammon.cpp.

References PlayerDialog::getAuto1(), PlayerDialog::getAuto2(), player1_auto, player2_auto, PlayerDialog::setAuto1(), and PlayerDialog::setAuto2().

Referenced by BackGammon().

void BackGammon::savegame  )  [private, slot]
 

Definition at line 368 of file backgammon.cpp.

References dice1_played, dice2_played, dice3_played, dice4_played, dice_rolled, diceA1_value, diceA2_value, diceA3_value, diceA4_value, diceB1_value, diceB3_value, diceB4_value, Config::File, game, game_name, move, player, player1_auto, player2_auto, LoadSave::pop, QPEApplication::qpeDir(), save(), MoveEngine::saveGame(), Config::setGroup(), QString::setNum(), Population::total, and Config::writeEntry().

Referenced by BackGammon().

void BackGammon::savetheme  )  [private, slot]
 

Definition at line 472 of file backgammon.cpp.

References board_name, diceA_name, diceB_name, Config::File, odds_name, piecesA_name, piecesB_name, QPEApplication::qpeDir(), Config::setGroup(), table_name, theme_name, and Config::writeEntry().

Referenced by BackGammon().

void BackGammon::setplayer  )  [private]
 

Definition at line 895 of file backgammon.cpp.

References autoroll_dice1(), autoroll_dice2(), dice1_played, dice2_played, dice3_played, dice4_played, dice_rolled, message, player, player1_auto, player2_auto, and tr.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), loadgame(), newgame(), and nomove2().

void BackGammon::setrules  )  [private, slot]
 

Definition at line 541 of file backgammon.cpp.

References Rules::generous_dice, RulesDialog::getRules(), move, Rules::move_with_pieces_out, rules, Config::setGroup(), MoveEngine::setRules(), RulesDialog::setRules(), tr, and Config::writeEntry().

Referenced by BackGammon().

void BackGammon::showdice  )  [private]
 

Definition at line 853 of file backgammon.cpp.

References diceA1, diceA1_value, diceA2, diceA2_value, diceA3_value, diceA4_value, diceB1, diceB1_value, diceB2, diceB2_value, diceB3_value, and diceB4_value.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), finished(), loadgame(), mouse(), newgame(), and nomove2().

void BackGammon::themedefault  )  [private, slot]
 

Definition at line 495 of file backgammon.cpp.

References Config::setGroup(), theme_name, and Config::writeEntry().

Referenced by BackGammon().


Member Data Documentation

QCanvas* BackGammon::area [private]
 

Definition at line 25 of file backgammon.h.

Referenced by BackGammon(), done_dice1(), done_dice2(), done_dice3(), done_dice4(), finished(), loadgame(), mouse(), newgame(), nomove(), and nomove2().

CanvasImageItem* BackGammon::board [private]
 

Definition at line 27 of file backgammon.h.

Referenced by applytheme(), and BackGammon().

QString BackGammon::board_name [private]
 

Definition at line 68 of file backgammon.h.

Referenced by applytheme(), BackGammon(), loadtheme(), newtheme(), and savetheme().

BackGammonView* BackGammon::boardview [private]
 

Definition at line 26 of file backgammon.h.

Referenced by BackGammon().

bool BackGammon::dice1_played [private]
 

Definition at line 57 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), loadgame(), mouse(), newgame(), nomove(), savegame(), and setplayer().

bool BackGammon::dice2_played [private]
 

Definition at line 58 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), loadgame(), mouse(), newgame(), nomove(), savegame(), and setplayer().

bool BackGammon::dice3_played [private]
 

Definition at line 59 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), loadgame(), mouse(), newgame(), nomove(), savegame(), and setplayer().

bool BackGammon::dice4_played [private]
 

Definition at line 60 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), loadgame(), mouse(), newgame(), nomove(), savegame(), and setplayer().

bool BackGammon::dice_rolled [private]
 

Definition at line 61 of file backgammon.h.

Referenced by loadgame(), mouse(), newgame(), savegame(), and setplayer().

CanvasImageItem** BackGammon::diceA1 [private]
 

Definition at line 34 of file backgammon.h.

Referenced by applytheme(), BackGammon(), and showdice().

int BackGammon::diceA1_value [private]
 

Definition at line 47 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), finished(), loadgame(), mouse(), newgame(), nomove(), savegame(), and showdice().

CanvasImageItem** BackGammon::diceA2 [private]
 

Definition at line 35 of file backgammon.h.

Referenced by applytheme(), BackGammon(), and showdice().

int BackGammon::diceA2_value [private]
 

Definition at line 48 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), finished(), loadgame(), mouse(), newgame(), nomove(), savegame(), and showdice().

int BackGammon::diceA3_value [private]
 

Definition at line 49 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), loadgame(), mouse(), newgame(), nomove(), savegame(), and showdice().

int BackGammon::diceA4_value [private]
 

Definition at line 50 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), loadgame(), mouse(), newgame(), nomove(), savegame(), and showdice().

QString BackGammon::diceA_name [private]
 

Definition at line 71 of file backgammon.h.

Referenced by applytheme(), BackGammon(), loadtheme(), newtheme(), and savetheme().

CanvasImageItem** BackGammon::diceB1 [private]
 

Definition at line 36 of file backgammon.h.

Referenced by applytheme(), BackGammon(), and showdice().

int BackGammon::diceB1_value [private]
 

Definition at line 51 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), finished(), loadgame(), mouse(), newgame(), nomove(), savegame(), and showdice().

CanvasImageItem** BackGammon::diceB2 [private]
 

Definition at line 37 of file backgammon.h.

Referenced by applytheme(), BackGammon(), and showdice().

int BackGammon::diceB2_value [private]
 

Definition at line 52 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), finished(), loadgame(), mouse(), newgame(), nomove(), and showdice().

int BackGammon::diceB3_value [private]
 

Definition at line 53 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), loadgame(), mouse(), newgame(), nomove(), savegame(), and showdice().

int BackGammon::diceB4_value [private]
 

Definition at line 54 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), loadgame(), mouse(), newgame(), nomove(), savegame(), and showdice().

QString BackGammon::diceB_name [private]
 

Definition at line 72 of file backgammon.h.

Referenced by applytheme(), BackGammon(), loadtheme(), newtheme(), and savetheme().

Display BackGammon::display [private]
 

Definition at line 83 of file backgammon.h.

QString BackGammon::game_name [private]
 

Definition at line 77 of file backgammon.h.

Referenced by deletegame(), loadgame(), newgame(), and savegame().

bool BackGammon::gameFinished [private]
 

Definition at line 85 of file backgammon.h.

Referenced by finished(), mouse(), and newgame().

QCanvasRectangle* BackGammon::marker_current [private]
 

Definition at line 41 of file backgammon.h.

Referenced by BackGammon(), and mouse().

QCanvasRectangle* BackGammon::marker_next[4] [private]
 

Definition at line 42 of file backgammon.h.

Referenced by BackGammon(), and mouse().

QLabel* BackGammon::message [private]
 

Definition at line 19 of file backgammon.h.

Referenced by BackGammon(), finished(), nomove(), and setplayer().

MoveEngine* BackGammon::move [private]
 

Definition at line 45 of file backgammon.h.

Referenced by BackGammon(), done_dice1(), done_dice2(), done_dice3(), done_dice4(), draw(), loadgame(), modify_AI(), mouse(), newgame(), savegame(), and setrules().

CanvasImageItem* BackGammon::nomove_marker [private]
 

Definition at line 39 of file backgammon.h.

Referenced by BackGammon(), finished(), nomove(), and nomove2().

QString BackGammon::odds_name [private]
 

Definition at line 73 of file backgammon.h.

Referenced by applytheme(), BackGammon(), loadtheme(), newtheme(), and savetheme().

CanvasImageItem** BackGammon::p1 [private]
 

Definition at line 29 of file backgammon.h.

Referenced by applytheme(), BackGammon(), and draw().

CanvasImageItem** BackGammon::p1_side [private]
 

Definition at line 31 of file backgammon.h.

Referenced by applytheme(), BackGammon(), and draw().

CanvasImageItem** BackGammon::p2 [private]
 

Definition at line 30 of file backgammon.h.

Referenced by applytheme(), BackGammon(), and draw().

CanvasImageItem** BackGammon::p2_side [private]
 

Definition at line 32 of file backgammon.h.

Referenced by applytheme(), BackGammon(), and draw().

QString BackGammon::piecesA_name [private]
 

Definition at line 69 of file backgammon.h.

Referenced by applytheme(), BackGammon(), loadtheme(), newtheme(), and savetheme().

QString BackGammon::piecesB_name [private]
 

Definition at line 70 of file backgammon.h.

Referenced by applytheme(), BackGammon(), loadtheme(), newtheme(), and savetheme().

int BackGammon::player [private]
 

Definition at line 56 of file backgammon.h.

Referenced by done_dice1(), done_dice2(), done_dice3(), done_dice4(), finished(), loadgame(), mouse(), newgame(), nomove(), savegame(), and setplayer().

bool BackGammon::player1_auto [private]
 

Definition at line 63 of file backgammon.h.

Referenced by BackGammon(), done_dice1(), done_dice2(), done_dice3(), done_dice4(), loadgame(), mouse(), playerselect(), savegame(), and setplayer().

bool BackGammon::player2_auto [private]
 

Definition at line 64 of file backgammon.h.

Referenced by BackGammon(), done_dice1(), done_dice2(), done_dice3(), done_dice4(), mouse(), playerselect(), savegame(), and setplayer().

Rules BackGammon::rules [private]
 

Definition at line 80 of file backgammon.h.

Referenced by BackGammon(), and setrules().

CanvasImageItem* BackGammon::table [private]
 

Definition at line 28 of file backgammon.h.

Referenced by applytheme(), and BackGammon().

QString BackGammon::table_name [private]
 

Definition at line 74 of file backgammon.h.

Referenced by applytheme(), BackGammon(), loadtheme(), newtheme(), and savetheme().

QString BackGammon::theme_name [private]
 

Definition at line 67 of file backgammon.h.

Referenced by BackGammon(), deletetheme(), loadtheme(), newtheme(), savetheme(), and themedefault().


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