author | cniehaus <cniehaus> | 2003-08-13 18:14:00 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2003-08-13 18:14:00 (UTC) |
commit | 7812d22080064f97d964dcbc3b085fde586a97d7 (patch) (unidiff) | |
tree | c7f7af3163c2c945e78a9bc91c6d8b8714a7f2e1 | |
parent | 7bb7c8f7f2af7854e3d50f07a8ff33ee3462c194 (diff) | |
download | opie-7812d22080064f97d964dcbc3b085fde586a97d7.zip opie-7812d22080064f97d964dcbc3b085fde586a97d7.tar.gz opie-7812d22080064f97d964dcbc3b085fde586a97d7.tar.bz2 |
more done, much more to do
-rw-r--r-- | noncore/games/oyatzee/oyatzee.cpp | 49 | ||||
-rw-r--r-- | noncore/games/oyatzee/oyatzee.h | 8 |
2 files changed, 43 insertions, 14 deletions
diff --git a/noncore/games/oyatzee/oyatzee.cpp b/noncore/games/oyatzee/oyatzee.cpp index 6228a8f..d0e220c 100644 --- a/noncore/games/oyatzee/oyatzee.cpp +++ b/noncore/games/oyatzee/oyatzee.cpp | |||
@@ -48,6 +48,6 @@ OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow( | |||
48 | ps.append( new Player( "Stephan" ) ); | 48 | ps.append( new Player( "Stephan" ) ); |
49 | 49 | ||
50 | Game *g = new Game( ps ); | 50 | //X Game *g = new Game( ps ); |
51 | 51 | //X | |
52 | 52 | ||
53 | QVBoxLayout *vbox = new QVBoxLayout( thing ); | 53 | QVBoxLayout *vbox = new QVBoxLayout( thing ); |
@@ -405,12 +405,4 @@ Board::Board( QWidget *parent , const char* name ) : QWidget ( parent , name ) | |||
405 | } | 405 | } |
406 | 406 | ||
407 | void Board::paintEvent( QPaintEvent* ) | ||
408 | { | ||
409 | QPainter p; | ||
410 | p.begin( this ); | ||
411 | |||
412 | p.drawRect( 0,0, this->width() , this->height() ); | ||
413 | } | ||
414 | |||
415 | /* | 407 | /* |
416 | * Resultboard | 408 | * Resultboard |
@@ -444,5 +436,34 @@ void Possibilityboard::paintEvent( QPaintEvent* ) | |||
444 | p.begin( this ); | 436 | p.begin( this ); |
445 | 437 | ||
446 | p.drawRect( 0,0, this->width() , this->height() ); | 438 | const int cell_width = this->width(); |
439 | const int h = this->height(); | ||
440 | const int cell_height = h/17; | ||
441 | |||
442 | QStringList begriffe; | ||
443 | begriffe.append( "1er" ); | ||
444 | begriffe.append( "2er" ); | ||
445 | begriffe.append( "3er" ); | ||
446 | begriffe.append( "4er" ); | ||
447 | begriffe.append( "5er" ); | ||
448 | begriffe.append( "6er" ); | ||
449 | begriffe.append( "Total" ); | ||
450 | begriffe.append( "Bonus" ); | ||
451 | begriffe.append( "3oaK" ); | ||
452 | begriffe.append( "4oaK" ); | ||
453 | begriffe.append( "Full House" ); | ||
454 | begriffe.append( "Short S" ); | ||
455 | begriffe.append( "Long S" ); | ||
456 | begriffe.append( "Yatzee!" ); | ||
457 | begriffe.append( "Chance" ); | ||
458 | begriffe.append( "Score" ); | ||
459 | |||
460 | QStringList::Iterator it = begriffe.begin(); | ||
461 | |||
462 | for ( int i = 1 ; i < 18 ; ++i ) | ||
463 | { | ||
464 | p.drawRect( 0 , i*cell_height , cell_width , cell_height ); | ||
465 | p.drawText( 0 , i*cell_height , cell_width , cell_height , Qt::AlignCenter , *it ); | ||
466 | ++it; | ||
467 | } | ||
447 | } | 468 | } |
448 | 469 | ||
@@ -456,2 +477,8 @@ Game::Game( playerList pla ) | |||
456 | } | 477 | } |
457 | 478 | ||
479 | void Game::startGame() | ||
480 | {} | ||
481 | |||
482 | void Game::stopGame() | ||
483 | {} | ||
484 | |||
diff --git a/noncore/games/oyatzee/oyatzee.h b/noncore/games/oyatzee/oyatzee.h index dd996ee..1074f1d 100644 --- a/noncore/games/oyatzee/oyatzee.h +++ b/noncore/games/oyatzee/oyatzee.h | |||
@@ -108,7 +108,4 @@ class Board : public QWidget | |||
108 | public: | 108 | public: |
109 | Board( QWidget *parent = 0, const char* name = 0 ); | 109 | Board( QWidget *parent = 0, const char* name = 0 ); |
110 | |||
111 | protected: | ||
112 | virtual void paintEvent( QPaintEvent *e ); | ||
113 | }; | 110 | }; |
114 | 111 | ||
@@ -167,5 +164,10 @@ class Game | |||
167 | public: | 164 | public: |
168 | Game( playerList pla ); | 165 | Game( playerList pla ); |
166 | |||
169 | playerList players; | 167 | playerList players; |
168 | int currentPlayer; | ||
169 | |||
170 | void startGame(); | ||
171 | void stopGame(); | ||
170 | }; | 172 | }; |
171 | 173 | ||