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

GoWidget Class Reference

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

Collaboration diagram for GoWidget:

Collaboration graph
[legend]
List of all members.

Public Slots

void pass ()
void resign ()
void newGame ()
void setTwoplayer (bool)
void setHandicap (int)

Signals

void showScore (const QString &)
void showTurn (const QPixmap &)

Public Member Functions

 GoWidget (QWidget *parent=0, const char *name=0)
 ~GoWidget ()
void doMove (int x, int y)
void doComputerMove ()
void readConfig ()
void writeConfig ()

Protected Member Functions

void paintEvent (QPaintEvent *)
void mousePressEvent (QMouseEvent *)
void mouseMoveEvent (QMouseEvent *)
void mouseReleaseEvent (QMouseEvent *)
void resizeEvent (QResizeEvent *)

Private Member Functions

void init ()
void removeStone (short x, short y)
void placeStone (enum bVal c, short x, short y)
void refresh (int x, int y)
void showStone (int x, int y, enum bVal)
void reportPrisoners (int, int)
int x2board (int x)
int y2board (int y)
void endGame ()

Private Attributes

bool twoplayer
enum bVal currentPlayer
bool gameActive
int nPassed
signed char board [19][19]
int d
int bx
int by
int lastX
int lastY
int newX
int newY

Static Private Attributes

static GoWidgetself = 0

Friends

void removestone (short x, short y)
void intrPrisonerReport (short, short)
void placestone (enum bVal c, short x, short y)

Constructor & Destructor Documentation

GoWidget::GoWidget QWidget *  parent = 0,
const char *  name = 0
 

Definition at line 116 of file gowidget.cpp.

References blackStone, bx, by, d, FALSE, fatal(), goBrush, init(), Opie::Core::OResource::loadPixmap(), newBlackStone, pix, twoplayer, and whiteStone.

GoWidget::~GoWidget  ) 
 

Definition at line 136 of file gowidget.cpp.

References writeConfig().


Member Function Documentation

void GoWidget::doComputerMove  ) 
 

Definition at line 328 of file gowidget.cpp.

References blackStone, computer_color, endGame(), lastX, lastY, nPassed, qApp, refresh(), showScore(), showTurn(), tr, Opie::MM::x, and Opie::MM::y.

Referenced by doMove(), init(), and pass().

void GoWidget::doMove int  x,
int  y
 

Definition at line 269 of file gowidget.cpp.

References BLACK, blackStone, currentPlayer, doComputerMove(), nPassed, showTurn(), twoplayer, WHITE, and whiteStone.

Referenced by mouseReleaseEvent().

void GoWidget::endGame  )  [private]
 

Definition at line 312 of file gowidget.cpp.

References FALSE, gameActive, s, showScore(), and tr.

Referenced by doComputerMove(), pass(), and resign().

void GoWidget::init  )  [private]
 

Definition at line 206 of file gowidget.cpp.

References BLACK, blackStone, board, current_handicap, currentPlayer, doComputerMove(), gameActive, i, lastX, lastY, newX, newY, nPassed, showTurn(), TRUE, twoplayer, WHITE, and whiteStone.

Referenced by GoWidget(), newGame(), and readConfig().

void GoWidget::mouseMoveEvent QMouseEvent *   )  [protected]
 

Definition at line 360 of file gowidget.cpp.

References currentPlayer, gameActive, newX, newY, showStone(), Opie::MM::x, x2board(), Opie::MM::y, and y2board().

void GoWidget::mousePressEvent QMouseEvent *   )  [protected]
 

Definition at line 351 of file gowidget.cpp.

References currentPlayer, gameActive, showStone(), Opie::MM::x, x2board(), Opie::MM::y, and y2board().

void GoWidget::mouseReleaseEvent QMouseEvent *   )  [protected]
 

Definition at line 389 of file gowidget.cpp.

References doMove(), gameActive, newX, and newY.

void GoWidget::newGame  )  [slot]
 

Definition at line 305 of file gowidget.cpp.

References init().

void GoWidget::paintEvent QPaintEvent *   )  [protected]
 

Definition at line 225 of file gowidget.cpp.

References BLACK, blackStone, board, bx, by, currentPlayer, d, goBrush, i, lastX, lastY, newBlackStone, newX, newY, p, WHITE, whiteStone, x2board(), and y2board().

void GoWidget::pass  )  [slot]
 

Definition at line 287 of file gowidget.cpp.

References doComputerMove(), endGame(), gameActive, nPassed, and twoplayer.

void GoWidget::placeStone enum bVal  c,
short  x,
short  y
[private]
 

Definition at line 407 of file gowidget.cpp.

References board, and refresh().

Referenced by placestone().

void GoWidget::readConfig  ) 
 

Definition at line 160 of file gowidget.cpp.

References BLACK, blackStone, currentPlayer, i, init(), lastX, lastY, QString::length(), nPassed, Config::readBoolEntry(), Config::readEntry(), Config::readNumEntry(), reportPrisoners(), Config::setGroup(), showTurn(), twoplayer, WHITE, and whiteStone.

void GoWidget::refresh int  x,
int  y
[private]
 

Definition at line 396 of file gowidget.cpp.

References bx, by, and d.

Referenced by doComputerMove(), placeStone(), removeStone(), and showStone().

void GoWidget::removeStone short  x,
short  y
[private]
 

Definition at line 401 of file gowidget.cpp.

References board, and refresh().

Referenced by removestone().

void GoWidget::reportPrisoners int  ,
int 
[private]
 

Definition at line 413 of file gowidget.cpp.

References s, showScore(), and tr.

Referenced by intrPrisonerReport(), and readConfig().

void GoWidget::resign  )  [slot]
 

Definition at line 298 of file gowidget.cpp.

References endGame(), and gameActive.

void GoWidget::resizeEvent QResizeEvent *   )  [protected]
 

Definition at line 185 of file gowidget.cpp.

References blackStone, bx, by, d, FALSE, height, Opie::Core::OResource::loadPixmap(), newBlackStone, smallStones, TRUE, whiteStone, and width.

void GoWidget::setHandicap int   )  [slot]
 

Definition at line 424 of file gowidget.cpp.

References current_handicap.

void GoWidget::setTwoplayer bool   )  [slot]
 

Definition at line 419 of file gowidget.cpp.

References twoplayer.

void GoWidget::showScore const QString  )  [signal]
 

Referenced by doComputerMove(), endGame(), and reportPrisoners().

void GoWidget::showStone int  x,
int  y,
enum  bVal
[private]
 

Definition at line 370 of file gowidget.cpp.

References board, newX, newY, and refresh().

Referenced by mouseMoveEvent(), and mousePressEvent().

void GoWidget::showTurn const QPixmap &   )  [signal]
 

Referenced by doComputerMove(), doMove(), init(), and readConfig().

void GoWidget::writeConfig  ) 
 

Definition at line 141 of file gowidget.cpp.

References BLACK, board, currentPlayer, i, lastX, lastY, nPassed, Config::setGroup(), twoplayer, WHITE, and Config::writeEntry().

Referenced by ~GoWidget().

int GoWidget::x2board int  x  )  [inline, private]
 

Definition at line 83 of file gowidget.h.

References bx, and d.

Referenced by mouseMoveEvent(), mousePressEvent(), and paintEvent().

int GoWidget::y2board int  y  )  [inline, private]
 

Definition at line 84 of file gowidget.h.

References by, and d.

Referenced by mouseMoveEvent(), mousePressEvent(), and paintEvent().


Friends And Related Function Documentation

void intrPrisonerReport short  blackcnt,
short  whitecnt
[friend]
 

Definition at line 447 of file gowidget.cpp.

void placestone enum bVal  c,
short  x,
short  y
[friend]
 

Definition at line 437 of file gowidget.cpp.

void removestone short  x,
short  y
[friend]
 

Definition at line 432 of file gowidget.cpp.


Member Data Documentation

signed char GoWidget::board[19][19] [private]
 

Definition at line 92 of file gowidget.h.

Referenced by init(), paintEvent(), placeStone(), removeStone(), showStone(), and writeConfig().

int GoWidget::bx [private]
 

Definition at line 95 of file gowidget.h.

Referenced by GoWidget(), paintEvent(), refresh(), resizeEvent(), and x2board().

int GoWidget::by [private]
 

Definition at line 96 of file gowidget.h.

Referenced by GoWidget(), paintEvent(), refresh(), resizeEvent(), and y2board().

enum bVal GoWidget::currentPlayer [private]
 

Definition at line 89 of file gowidget.h.

Referenced by doMove(), init(), mouseMoveEvent(), mousePressEvent(), paintEvent(), readConfig(), and writeConfig().

int GoWidget::d [private]
 

Definition at line 94 of file gowidget.h.

Referenced by GoWidget(), paintEvent(), refresh(), resizeEvent(), x2board(), and y2board().

bool GoWidget::gameActive [private]
 

Definition at line 90 of file gowidget.h.

Referenced by endGame(), init(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), pass(), and resign().

int GoWidget::lastX [private]
 

Definition at line 98 of file gowidget.h.

Referenced by doComputerMove(), init(), paintEvent(), readConfig(), and writeConfig().

int GoWidget::lastY [private]
 

Definition at line 98 of file gowidget.h.

Referenced by doComputerMove(), init(), paintEvent(), readConfig(), and writeConfig().

int GoWidget::newX [private]
 

Definition at line 99 of file gowidget.h.

Referenced by init(), mouseMoveEvent(), mouseReleaseEvent(), paintEvent(), and showStone().

int GoWidget::newY [private]
 

Definition at line 99 of file gowidget.h.

Referenced by init(), mouseMoveEvent(), mouseReleaseEvent(), paintEvent(), and showStone().

int GoWidget::nPassed [private]
 

Definition at line 91 of file gowidget.h.

Referenced by doComputerMove(), doMove(), init(), pass(), readConfig(), and writeConfig().

GoWidget * GoWidget::self = 0 [static, private]
 

Definition at line 114 of file gowidget.cpp.

bool GoWidget::twoplayer [private]
 

Definition at line 88 of file gowidget.h.

Referenced by doMove(), GoWidget(), init(), pass(), readConfig(), setTwoplayer(), and writeConfig().


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