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

QTetrixBoard Class Reference

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

Inheritance diagram for QTetrixBoard:

Inheritance graph
[legend]
Collaboration diagram for QTetrixBoard:

Collaboration graph
[legend]
List of all members.

Public Slots

void timeout ()
void updateNext ()
void key (QKeyEvent *e)
void start ()
void pause ()

Signals

void gameOverSignal ()
void drawNextSquareSignal (int x, int y, QColor *color1)
void updateRemovedSignal (int noOfLines)
void updateScoreSignal (int score)
void updateLevelSignal (int level)

Public Member Functions

 QTetrixBoard (QWidget *parent=0, const char *name=0)
void gameOver ()
void startGame (int gameType=0, int fillRandomLines=0)
void keyPressEvent (QKeyEvent *)

Private Member Functions

void drawContents (QPainter *)
void resizeEvent (QResizeEvent *)
void drawSquare (int x, int y, int value)
void drawNextSquare (int x, int y, int value)
void updateRemoved (int noOfLines)
void updateScore (int newScore)
void updateLevel (int newLlevel)
void pieceDropped (int dropHeight)
void updateTimeoutTime ()

Private Attributes

QTimer * timer
int xOffset
int yOffset
int blockWidth
int blockHeight
int timeoutTime
bool noGame
bool isPaused
bool waitingAfterLine
QColor colors [7]
QPainter * paint

Constructor & Destructor Documentation

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

Definition at line 28 of file qtetrixb.cpp.

References blockHeight, blockWidth, colors, FALSE, isPaused, noGame, paint, timeout(), timer, TRUE, updateTimeoutTime(), waitingAfterLine, xOffset, and yOffset.


Member Function Documentation

void QTetrixBoard::drawContents QPainter *   )  [private]
 

Definition at line 168 of file qtetrixb.cpp.

References blockHeight, blockWidth, GenericTetrix::boardHeight(), GenericTetrix::boardWidth(), isPaused, paint, text, TRUE, GenericTetrix::updateBoard(), xOffset, and yOffset.

void QTetrixBoard::drawNextSquare int  x,
int  y,
int  value
[private, virtual]
 

Reimplemented from GenericTetrix.

Definition at line 111 of file qtetrixb.cpp.

References colors, and drawNextSquareSignal().

void QTetrixBoard::drawNextSquareSignal int  x,
int  y,
QColor *  color1
[signal]
 

Referenced by drawNextSquare().

void QTetrixBoard::drawSquare int  x,
int  y,
int  value
[private, virtual]
 

Implements GenericTetrix.

Definition at line 80 of file qtetrixb.cpp.

References blockHeight, blockWidth, colors, drawTetrixButton(), p, paint, X, xOffset, and yOffset.

void QTetrixBoard::gameOver  )  [virtual]
 

Implements GenericTetrix.

Definition at line 149 of file qtetrixb.cpp.

References gameOverSignal(), noGame, timer, and TRUE.

void QTetrixBoard::gameOverSignal  )  [signal]
 

Referenced by gameOver().

void QTetrixBoard::key QKeyEvent *  e  )  [inline, slot]
 

Definition at line 42 of file qtetrixb.h.

References keyPressEvent().

void QTetrixBoard::keyPressEvent QKeyEvent *   ) 
 

Definition at line 220 of file qtetrixb.cpp.

References GenericTetrix::dropDown(), isPaused, Key_D, GenericTetrix::moveLeft(), GenericTetrix::moveRight(), noGame, GenericTetrix::oneLineDown(), GenericTetrix::rotateLeft(), and waitingAfterLine.

Referenced by key(), and QTetrix::keyPressEvent().

void QTetrixBoard::pause  )  [slot]
 

Definition at line 65 of file qtetrixb.cpp.

References GenericTetrix::hideBoard(), isPaused, noGame, timeoutTime, and timer.

void QTetrixBoard::pieceDropped int  dropHeight  )  [private, virtual]
 

Reimplemented from GenericTetrix.

Definition at line 142 of file qtetrixb.cpp.

References GenericTetrix::newPiece(), and waitingAfterLine.

void QTetrixBoard::resizeEvent QResizeEvent *   )  [private]
 

Definition at line 207 of file qtetrixb.cpp.

References blockHeight, blockWidth, xOffset, and yOffset.

void QTetrixBoard::start void   )  [inline, slot]
 

Definition at line 43 of file qtetrixb.h.

References startGame().

void QTetrixBoard::startGame int  gameType = 0,
int  fillRandomLines = 0
[virtual]
 

Reimplemented from GenericTetrix.

Definition at line 54 of file qtetrixb.cpp.

References FALSE, isPaused, noGame, and GenericTetrix::startGame().

Referenced by start(), and QTetrix::startGame().

void QTetrixBoard::timeout  )  [slot]
 

Definition at line 156 of file qtetrixb.cpp.

References FALSE, GenericTetrix::newPiece(), GenericTetrix::oneLineDown(), timeoutTime, timer, and waitingAfterLine.

Referenced by QTetrixBoard().

void QTetrixBoard::updateLevel int  newLlevel  )  [private, virtual]
 

Reimplemented from GenericTetrix.

Definition at line 134 of file qtetrixb.cpp.

References timeoutTime, timer, updateLevelSignal(), and updateTimeoutTime().

void QTetrixBoard::updateLevelSignal int  level  )  [signal]
 

Referenced by updateLevel().

void QTetrixBoard::updateNext  )  [inline, slot]
 

Reimplemented from GenericTetrix.

Definition at line 41 of file qtetrixb.h.

References GenericTetrix::updateNext().

void QTetrixBoard::updateRemoved int  noOfLines  )  [private, virtual]
 

Reimplemented from GenericTetrix.

Definition at line 119 of file qtetrixb.cpp.

References timer, TRUE, updateRemovedSignal(), waitAfterLineTime, and waitingAfterLine.

void QTetrixBoard::updateRemovedSignal int  noOfLines  )  [signal]
 

Referenced by updateRemoved().

void QTetrixBoard::updateScore int  newScore  )  [private, virtual]
 

Reimplemented from GenericTetrix.

Definition at line 129 of file qtetrixb.cpp.

References updateScoreSignal().

void QTetrixBoard::updateScoreSignal int  score  )  [signal]
 

Referenced by updateScore().

void QTetrixBoard::updateTimeoutTime  )  [private]
 

Definition at line 250 of file qtetrixb.cpp.

References GenericTetrix::getLevel(), and timeoutTime.

Referenced by QTetrixBoard(), and updateLevel().


Member Data Documentation

int QTetrixBoard::blockHeight [private]
 

Definition at line 70 of file qtetrixb.h.

Referenced by drawContents(), drawSquare(), QTetrixBoard(), and resizeEvent().

int QTetrixBoard::blockWidth [private]
 

Definition at line 70 of file qtetrixb.h.

Referenced by drawContents(), drawSquare(), QTetrixBoard(), and resizeEvent().

QColor QTetrixBoard::colors[7] [private]
 

Definition at line 76 of file qtetrixb.h.

Referenced by drawNextSquare(), drawSquare(), and QTetrixBoard().

bool QTetrixBoard::isPaused [private]
 

Definition at line 73 of file qtetrixb.h.

Referenced by drawContents(), keyPressEvent(), pause(), QTetrixBoard(), and startGame().

bool QTetrixBoard::noGame [private]
 

Definition at line 72 of file qtetrixb.h.

Referenced by gameOver(), keyPressEvent(), pause(), QTetrixBoard(), and startGame().

QPainter* QTetrixBoard::paint [private]
 

Definition at line 77 of file qtetrixb.h.

Referenced by drawContents(), drawSquare(), and QTetrixBoard().

int QTetrixBoard::timeoutTime [private]
 

Definition at line 71 of file qtetrixb.h.

Referenced by pause(), timeout(), updateLevel(), and updateTimeoutTime().

QTimer* QTetrixBoard::timer [private]
 

Definition at line 67 of file qtetrixb.h.

Referenced by gameOver(), pause(), QTetrixBoard(), timeout(), updateLevel(), and updateRemoved().

bool QTetrixBoard::waitingAfterLine [private]
 

Definition at line 74 of file qtetrixb.h.

Referenced by keyPressEvent(), pieceDropped(), QTetrixBoard(), timeout(), and updateRemoved().

int QTetrixBoard::xOffset [private]
 

Definition at line 69 of file qtetrixb.h.

Referenced by drawContents(), drawSquare(), QTetrixBoard(), and resizeEvent().

int QTetrixBoard::yOffset [private]
 

Definition at line 69 of file qtetrixb.h.

Referenced by drawContents(), drawSquare(), QTetrixBoard(), and resizeEvent().


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