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

WordGame Class Reference

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

Collaboration diagram for WordGame:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Static Public Member Functions

static QString appName ()

Private Slots

void endTurn ()
void resetTurn ()
void passTurn ()
void think ()
void endGame ()
void startGame ()

Private Member Functions

void writeConfig ()
void readConfig ()
void startGame (const QStringList &pnames)
bool mayEndGame ()
void openGameSelector (const QStringList &initnames)
bool loadRules (const QString &filename)
void addPlayer (const QString &name)
void addPlayer (const QString &name, int cpu)
void nextPlayer ()
bool refillRack (int i)
void readyRack (int i)
Rackrack (int i) const

Private Attributes

QWidgetStack * racks
QToolBar * toolbar
QWidget * vbox
Boardboard
Bagbag
ScoreInfoscoreinfo
QToolButton * done
QToolButton * reset
QTimer * aiheart
ComputerPlayercpu
int player
int nplayers
QStringList namelist
bool gameover
QString rules
NewGamenewgame

Constructor & Destructor Documentation

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

Definition at line 110 of file wordgame.cpp.

References aiheart, bag, board, cpu, done, endGame(), endTurn(), FALSE, Opie::Core::OResource::loadPixmap(), qApp, racks, readConfig(), reset, resetTurn(), scoreinfo, Opie::Core::OResource::SmallIcon, think(), tile_bigh, tile_bigw, tile_btweak, tile_smallh, tile_smallw, tile_stweak, toolbar, tr, and vbox.

WordGame::~WordGame  ) 
 

Definition at line 156 of file wordgame.cpp.

References writeConfig().


Member Function Documentation

void WordGame::addPlayer const QString name,
int  cpu
[private]
 

Definition at line 416 of file wordgame.cpp.

References QValueList< T >::append(), namelist, nplayers, rack_tiles, racks, refillRack(), Rack::setComputerization(), and Rack::setPlayerName().

void WordGame::addPlayer const QString name  )  [private]
 

Definition at line 407 of file wordgame.cpp.

References cpu, QString::find(), QString::isEmpty(), QString::left(), and QString::mid().

Referenced by startGame().

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

Definition at line 312 of file wordgame.h.

References QString::fromLatin1().

void WordGame::endGame  )  [private, slot]
 

Definition at line 457 of file wordgame.cpp.

References ScoreInfo::addScore(), Rack::count(), done, FALSE, gameover, i, mayEndGame(), nplayers, out, ScoreInfo::playerScore(), rack(), reset, s, scoreinfo, ScoreInfo::setBoldOne(), Rack::tileRef(), and TRUE.

Referenced by nextPlayer(), and WordGame().

void WordGame::endTurn  )  [private, slot]
 

Definition at line 499 of file wordgame.cpp.

References ScoreInfo::addScore(), board, Board::checkTurn(), Board::finalizeTurn(), gameover, namelist, nextPlayer(), openGameSelector(), player, scoreinfo, and Board::turnScore().

Referenced by think(), and WordGame().

bool WordGame::loadRules const QString filename  )  [private]
 

Definition at line 281 of file wordgame.cpp.

References Bag::add(), Global::applicationFileName(), bag, Board, board, FALSE, i, IO_ReadOnly, QString::length(), Opie::Core::OResource::loadImage(), QFile::open(), scoreinfo, Board::setRules(), TileItem::smallHeight(), TileItem::smallWidth(), t, text, title, TRUE, QString::truncate(), and vbox.

Referenced by readConfig(), and startGame().

bool WordGame::mayEndGame  )  [private]
 

Definition at line 439 of file wordgame.cpp.

References FALSE, i, nplayers, out, rack(), tr, TRUE, and warning().

Referenced by endGame().

void WordGame::nextPlayer  )  [private]
 

Definition at line 428 of file wordgame.cpp.

References endGame(), nplayers, player, readyRack(), refillRack(), scoreinfo, and ScoreInfo::setBoldOne().

Referenced by endTurn(), and passTurn().

void WordGame::openGameSelector const QStringList initnames  )  [private]
 

Definition at line 210 of file wordgame.cpp.

References board, cpu, FALSE, gameover, QString::isEmpty(), newgame, racks, startGame(), toolbar, NewGame::updateRuleSets(), and vbox.

Referenced by endTurn(), and readConfig().

void WordGame::passTurn  )  [private, slot]
 

Definition at line 521 of file wordgame.cpp.

References nextPlayer().

Referenced by think().

Rack * WordGame::rack int  i  )  const [private]
 

Definition at line 551 of file wordgame.cpp.

References racks.

Referenced by endGame(), mayEndGame(), readConfig(), readyRack(), refillRack(), and writeConfig().

void WordGame::readConfig  )  [private]
 

Definition at line 179 of file wordgame.cpp.

References bag, board, FALSE, QString::find(), gameover, loadRules(), nplayers, QString::number(), openGameSelector(), p, player, rack(), ScoreInfo::readConfig(), Board::readConfig(), Bag::readConfig(), Config::readEntry(), Config::readListEntry(), Config::readNumEntry(), readyRack(), rules, scoreinfo, Config::setGroup(), and startGame().

Referenced by WordGame().

void WordGame::readyRack int  i  )  [private]
 

Definition at line 536 of file wordgame.cpp.

References aiheart, board, cpu, done, rack(), racks, reset, and Board::setCurrentRack().

Referenced by nextPlayer(), readConfig(), and startGame().

bool WordGame::refillRack int  i  )  [private]
 

Definition at line 527 of file wordgame.cpp.

References Rack::addTile(), bag, Rack::count(), Bag::isEmpty(), Rack::isFull(), rack(), and Bag::takeRandom().

Referenced by addPlayer(), and nextPlayer().

void WordGame::resetTurn  )  [private, slot]
 

Definition at line 516 of file wordgame.cpp.

References board, and Board::resetRack().

Referenced by WordGame().

void WordGame::startGame const QStringList pnames  )  [private]
 

Definition at line 261 of file wordgame.cpp.

References addPlayer(), QValueList< T >::begin(), TileItem::bigHeight(), board, QValueList< T >::clear(), QValueList< T >::end(), ScoreInfo::init(), namelist, nplayers, player, racks, readyRack(), scoreinfo, toolbar, and vbox.

void WordGame::startGame  )  [private, slot]
 

Definition at line 241 of file wordgame.cpp.

References QValueList< T >::append(), loadRules(), newgame, rules, and NewGame::ruleslist.

Referenced by openGameSelector(), and readConfig().

void WordGame::think  )  [private, slot]
 

Definition at line 556 of file wordgame.cpp.

References aiheart, board, cpu, endTurn(), passTurn(), ComputerPlayer::step(), and Board::turnScore().

Referenced by WordGame().

void WordGame::writeConfig  )  [private]
 

Definition at line 161 of file wordgame.cpp.

References bag, board, Config::clearGroup(), gameover, namelist, nplayers, QString::number(), p, player, rack(), rules, scoreinfo, Config::setGroup(), ScoreInfo::writeConfig(), Board::writeConfig(), Bag::writeConfig(), and Config::writeEntry().

Referenced by ~WordGame().


Member Data Documentation

QTimer* WordGame::aiheart [private]
 

Definition at line 345 of file wordgame.h.

Referenced by readyRack(), think(), and WordGame().

Bag* WordGame::bag [private]
 

Definition at line 341 of file wordgame.h.

Referenced by loadRules(), readConfig(), refillRack(), WordGame(), and writeConfig().

Board* WordGame::board [private]
 

Definition at line 340 of file wordgame.h.

Referenced by endTurn(), loadRules(), openGameSelector(), readConfig(), readyRack(), resetTurn(), startGame(), think(), WordGame(), and writeConfig().

ComputerPlayer* WordGame::cpu [private]
 

Definition at line 346 of file wordgame.h.

Referenced by addPlayer(), openGameSelector(), readyRack(), think(), and WordGame().

QToolButton* WordGame::done [private]
 

Definition at line 343 of file wordgame.h.

Referenced by endGame(), readyRack(), and WordGame().

bool WordGame::gameover [private]
 

Definition at line 350 of file wordgame.h.

Referenced by endGame(), endTurn(), openGameSelector(), readConfig(), and writeConfig().

QStringList WordGame::namelist [private]
 

Definition at line 349 of file wordgame.h.

Referenced by addPlayer(), endTurn(), startGame(), and writeConfig().

NewGame* WordGame::newgame [private]
 

Definition at line 352 of file wordgame.h.

Referenced by openGameSelector(), and startGame().

int WordGame::nplayers [private]
 

Definition at line 348 of file wordgame.h.

Referenced by addPlayer(), endGame(), mayEndGame(), nextPlayer(), readConfig(), startGame(), and writeConfig().

int WordGame::player [private]
 

Definition at line 347 of file wordgame.h.

Referenced by endTurn(), nextPlayer(), readConfig(), startGame(), and writeConfig().

QWidgetStack* WordGame::racks [private]
 

Definition at line 337 of file wordgame.h.

Referenced by addPlayer(), openGameSelector(), rack(), readyRack(), startGame(), and WordGame().

QToolButton* WordGame::reset [private]
 

Definition at line 344 of file wordgame.h.

Referenced by endGame(), readyRack(), and WordGame().

QString WordGame::rules [private]
 

Definition at line 351 of file wordgame.h.

Referenced by readConfig(), startGame(), and writeConfig().

ScoreInfo* WordGame::scoreinfo [private]
 

Definition at line 342 of file wordgame.h.

Referenced by endGame(), endTurn(), loadRules(), nextPlayer(), readConfig(), startGame(), WordGame(), and writeConfig().

QToolBar* WordGame::toolbar [private]
 

Definition at line 338 of file wordgame.h.

Referenced by openGameSelector(), startGame(), and WordGame().

QWidget* WordGame::vbox [private]
 

Definition at line 339 of file wordgame.h.

Referenced by loadRules(), openGameSelector(), startGame(), and WordGame().


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