summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/games/oyatzee/oyatzee.cpp445
-rw-r--r--noncore/games/oyatzee/oyatzee.h92
2 files changed, 395 insertions, 142 deletions
diff --git a/noncore/games/oyatzee/oyatzee.cpp b/noncore/games/oyatzee/oyatzee.cpp
index d0e220c..0bd22f6 100644
--- a/noncore/games/oyatzee/oyatzee.cpp
+++ b/noncore/games/oyatzee/oyatzee.cpp
@@ -2,33 +2,14 @@
2 2
3#include <qpe/applnk.h>
4#include <qpe/global.h>
5#include <qpe/filemanager.h>
6#include <qpe/resource.h>
7#include <qpe/config.h>
8
9#include <qapplication.h>
10#include <qmessagebox.h> 3#include <qmessagebox.h>
11#include <qcombobox.h> 4#include <qapplication.h>
12#include <qdatetime.h>
13#include <qfileinfo.h>
14#include <qfile.h>
15#include <qdir.h> 5#include <qdir.h>
16#include <qiconset.h>
17#include <qlabel.h> 6#include <qlabel.h>
18#include <qlineedit.h>
19#include <qpushbutton.h> 7#include <qpushbutton.h>
20#include <qtextstream.h>
21#include <qtimer.h> 8#include <qtimer.h>
22#include <qpe/qpetoolbar.h>
23#include <qtoolbutton.h>
24#include <qvbox.h> 9#include <qvbox.h>
25#include <qwidgetstack.h>
26#include <qpainter.h> 10#include <qpainter.h>
27#include <qlayout.h> 11#include <qlayout.h>
28#include <qregexp.h> 12#include <qpoint.h>
29 13
30#include <stdlib.h> 14#include <stdlib.h>
31#include <unistd.h>
32#include <pwd.h>
33#include <sys/types.h>
34 15
@@ -39,2 +20,3 @@ OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow(
39 20
21 setCaption( tr( "OYatzee" ) );
40 22
@@ -43,3 +25,5 @@ OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow(
43 25
44 playerList ps; 26 lastPlayerFinished = false;
27 currentPlayer = 1;
28
45 ps.append( new Player( "Carsten" ) ); 29 ps.append( new Player( "Carsten" ) );
@@ -49,4 +33,2 @@ OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow(
49 33
50 //X Game *g = new Game( ps );
51 //X
52 34
@@ -55,3 +37,6 @@ OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow(
55 sb = new Scoreboard( ps, thing , "sb" ); 37 sb = new Scoreboard( ps, thing , "sb" );
38 connect( sb->pb , SIGNAL( item( int ) ), this , SLOT( slotEndRound( int ) ) );
39
56 dw = new DiceWidget( thing , "dw" ); 40 dw = new DiceWidget( thing , "dw" );
41 dw->setMaximumHeight( this->height()/4 );
57 connect( dw->rollButton, SIGNAL( clicked() ), this , SLOT( slotRollDices() ) ); 42 connect( dw->rollButton, SIGNAL( clicked() ), this , SLOT( slotRollDices() ) );
@@ -62,2 +47,112 @@ OYatzee::OYatzee( QWidget *parent , const char *name, WFlags fl ) : QMainWindow(
62 47
48void OYatzee::slotEndRound( int item )
49{
50 qDebug( "Der User hat Nummer %d ausgewählt" , item );
51
52 /*
53 * if the user clicked on Total, Bonus or Score and thus not on a
54 * selectable item return and do nothing
55 */
56 if ( item == 7 || item == 8 || item == 16 ) return;
57
58 /*
59 * check if the user can really click on that item
60 */
61 if ( posibilities.find( item ) == posibilities.end() ) return;
62
63 QValueListInt numbers;
64
65 Dice *d = dw->diceList.first();
66 for ( ; d != 0 ; d = dw->diceList.next() )
67 {
68 numbers.append( d->hasValue() );
69 }
70
71 int points = 0;
72
73 switch ( item )
74 {
75 case Ones:
76 points = getPoints( 1 , numbers );
77 break;
78 case Twos:
79 points = getPoints( 2 , numbers );
80 break;
81 case Threes:
82 points = getPoints( 3 , numbers );
83 break;
84 case Fours:
85 points = getPoints( 4 , numbers );
86 break;
87 case Fives:
88 points = getPoints( 5 , numbers );
89 break;
90 case Sixes:
91 points = getPoints( 6 , numbers );
92 break;
93 case ThreeOfAKind:
94 points = oakPoints;
95 break;
96 case FourOfAKind:
97 points = oakPoints;
98 break;
99 case FullHouse:
100 points = 25;
101 break;
102 case SStraight:
103 points = 30;
104 break;
105 case LStraight:
106 points = 40;
107 break;
108 case Yatzee:
109 points = 50;
110 break;
111 case Chance:
112 points = getPoints ( Chance , numbers );
113 }
114
115 sb->nextRB(currentPlayer-1)->updateMap( item , points );
116 nextPlayer();
117
118 qDebug( "Punkte: %d" , points );
119}
120
121void OYatzee::nextPlayer()
122{
123 currentPlayer++;
124
125 if ( currentPlayer > numOfPlayers )
126 {
127 currentPlayer = 1;
128 }
129
130 ps.at(currentPlayer-1)->turn = 0;
131}
132
133int OYatzee::getPoints( const int num , QValueListInt l)
134{
135 QValueListInt::Iterator it = l.begin();
136 int c = 0;
137
138 if ( num != Chance )
139 {
140 for ( ; it != l.end() ; ++it )
141 {
142 if ( *it == num )
143 c++;
144 }
145
146 return c * num;
147 }
148 else
149 {
150 for ( ; it != l.end() ; ++it )
151 {
152 c += *it;
153 }
154 return c;
155 }
156 }
157
63OYatzee::~OYatzee() 158OYatzee::~OYatzee()
@@ -77,3 +172,3 @@ void OYatzee::detectPosibilities()
77 { 172 {
78 numbers.append( d->Value ); 173 numbers.append( d->hasValue() );
79 } 174 }
@@ -100,3 +195,2 @@ void OYatzee::detectPosibilities()
100 195
101
102 //3er, 4er, Yatzee 196 //3er, 4er, Yatzee
@@ -125,3 +219,3 @@ void OYatzee::detectPosibilities()
125 { 219 {
126 posibilities.append( 7 ); 220 posibilities.append( 9 );
127 221
@@ -129,8 +223,10 @@ void OYatzee::detectPosibilities()
129 if ( count == 3 && countFH == 2 ) //aka Full House 223 if ( count == 3 && countFH == 2 ) //aka Full House
130 posibilities.append( 9 ); 224 posibilities.append( 11 );
131 }
132 if ( count >= 4 ) 225 if ( count >= 4 )
133 posibilities.append( 8 ); 226 posibilities.append( 10 );
134 if ( count == 5 ) //Yatzee 227 if ( count == 5 ) //Yatzee
135 posibilities.append( 12 ); 228 posibilities.append( 14 );
229
230 oakPoints = count * i;
231 }
136 } 232 }
@@ -159,5 +255,5 @@ void OYatzee::detectPosibilities()
159 if ( isShort ) 255 if ( isShort )
160 posibilities.append( 10 ); 256 posibilities.append( 12 );
161 if ( isLong ) 257 if ( isLong )
162 posibilities.append( 11 ); 258 posibilities.append( 13 );
163 } 259 }
@@ -171,50 +267,62 @@ void OYatzee::displayPossibilites()
171{ 267{
172 for ( QValueListInt::Iterator it = posibilities.begin() ; it != posibilities.end(); ++it ) 268 //X for ( QValueListInt::Iterator it = posibilities.begin() ; it != posibilities.end(); ++it )
269 //X {
270 //X qDebug( QString::number( *it ) );
271 //X switch ( *it )
272 //X {
273 //X case Ones:
274 //X qDebug( "1er" );
275 //X break;
276 //X case Twos:
277 //X qDebug( "2er" );
278 //X break;
279 //X case Threes:
280 //X qDebug( "3er" );
281 //X break;
282 //X case Fours:
283 //X qDebug( "4er" );
284 //X break;
285 //X case Fives:
286 //X qDebug( "5er" );
287 //X break;
288 //X case Sixes:
289 //X qDebug( "6er" );
290 //X break;
291 //X case ThreeOfAKind:
292 //X qDebug( "3oaK" );
293 //X break;
294 //X case FourOfAKind:
295 //X qDebug( "4oaK" );
296 //X break;
297 //X case FullHouse:
298 //X qDebug( "Full House" );
299 //X break;
300 //X case SStraight:
301 //X qDebug( "Short S" );
302 //X break;
303 //X case LStraight:
304 //X qDebug( "Long S" );
305 //X break;
306 //X case Yatzee:
307 //X qDebug( "Yatzee!" );
308 //X break;
309 //X case Chance:
310 //X qDebug( "Chance" );
311 //X break;
312 //X }
313 //X }
314
315 sb->pb->setIntlist( posibilities );
316 sb->pb->update();
317}
318
319void OYatzee::startGame()
173 { 320 {
174 qDebug( QString::number( *it ) ); 321 /*
175 switch ( *it ) 322 * TODO
176 { 323 */
177 case Ones:
178 qDebug( "1er" );
179 break;
180 case Twos:
181 qDebug( "2er" );
182 break;
183 case Threes:
184 qDebug( "3er" );
185 break;
186 case Fours:
187 qDebug( "4er" );
188 break;
189 case Fives:
190 qDebug( "5er" );
191 break;
192 case Sixes:
193 qDebug( "6er" );
194 break;
195 case ThreeOfAKind:
196 qDebug( "3oaK" );
197 break;
198 case FourOfAKind:
199 qDebug( "4oaK" );
200 break;
201 case FullHouse:
202 qDebug( "Full House" );
203 break;
204 case SStraight:
205 qDebug( "Short S" );
206 break;
207 case LStraight:
208 qDebug( "Long S" );
209 break;
210 case Yatzee:
211 qDebug( "Yatzee!" );
212 break;
213 case Chance:
214 qDebug( "Chance" );
215 break;
216 }
217 }
218} 324}
219 325
326void OYatzee::stopGame(){}
327
220void OYatzee::setPlayerNumber( const int num ) 328void OYatzee::setPlayerNumber( const int num )
@@ -235,2 +343,12 @@ void OYatzee::slotRollDices()
235{ 343{
344 qDebug( "Roll nummer: %d" , ps.at( currentPlayer-1 )->turn );
345
346 if ( ps.at( currentPlayer-1 )->turn == 3 )
347 {
348 QMessageBox::information( this,
349 "OYatzee",
350 tr( "Only three rolls per turn allowed." ) );
351 return;
352 }
353
236 Dice *d = dw->diceList.first(); 354 Dice *d = dw->diceList.first();
@@ -243,2 +361,6 @@ void OYatzee::slotRollDices()
243 361
362 //qDebug( "Roll nummer (vorher): %d" , ps.at( currentPlayer-1 )->turn );
363 ps.at(currentPlayer-1)->turn++;
364 //qDebug( "Roll nummer (nachher): %d" , ps.at( currentPlayer-1 )->turn );
365
244 detectPosibilities(); 366 detectPosibilities();
@@ -271,2 +393,13 @@ Scoreboard::Scoreboard( playerList ps, QWidget *parent, const char *name ) : QWi
271 393
394Resultboard* Scoreboard::nextRB( int currentPlayer )
395{
396 Resultboard *b;
397
398 b = rbList.at( currentPlayer );
399
400 qDebug( "Anzahl: %d" ,rbList.count() );
401
402 return b;
403 }
404
272void Scoreboard::createResultboards(const int num) 405void Scoreboard::createResultboards(const int num)
@@ -283,6 +416,6 @@ void Scoreboard::paintEvent( QPaintEvent * )
283{ 416{
284 QPainter p; 417 //X QPainter p;
285 p.begin( this ); 418 //X p.begin( this );
286 419//X
287 p.drawRect( 0,0, this->width() , this->height() ); 420 //X p.drawRect( 0,0, this->width() , this->height() );
288} 421}
@@ -309,3 +442,3 @@ void Dice::slotSelected()
309 442
310int Dice::hasValue() 443const int Dice::hasValue() const
311{ 444{
@@ -342,2 +475,9 @@ void Dice::paintNumber( QPainter *p )
342{ 475{
476 p->setBrush( Qt::black );
477
478 int w = this->width();
479 int h = this->height();
480 int r = this->width();
481 r /= 10;
482
343 switch ( Value ) 483 switch ( Value )
@@ -345,18 +485,33 @@ void Dice::paintNumber( QPainter *p )
345 case 1: 485 case 1:
346 p->drawText( 10,10,"1"); 486 p->drawEllipse( (int)( 0.5*w - r ) , (int)( 0.5*h - r ) , r , r ) ;
347 break; 487 break;
348 case 2: 488 case 2:
349 p->drawText( 10,10,"2"); 489 p->drawEllipse( (int)( 0.3*w - r ) , (int)( 0.3*h - r ) , r , r ) ;
490 p->drawEllipse( (int)( 0.7*w - r ) , (int)( 0.7*h - r ) , r , r ) ;
350 break; 491 break;
351 case 3: 492 case 3:
352 p->drawText( 10,10,"3"); 493 p->drawEllipse( (int)( 0.5*w - r ) , (int)( 0.5*h - r ) , r , r ) ;
494 p->drawEllipse( (int)( 0.2*w - r ) , (int)( 0.2*h - r ) , r , r ) ;
495 p->drawEllipse( (int)( 0.8*w - r ) , (int)( 0.8*h - r ) , r , r ) ;
353 break; 496 break;
354 case 4: 497 case 4:
355 p->drawText( 10,10,"4"); 498 p->drawEllipse( (int)( 0.2*w - r ) , (int)( 0.2*h - r ) , r , r ) ;
499 p->drawEllipse( (int)( 0.8*w - r ) , (int)( 0.8*h - r ) , r , r ) ;
500 p->drawEllipse( (int)( 0.8*w - r ) , (int)( 0.2*h - r ) , r , r ) ;
501 p->drawEllipse( (int)( 0.2*w - r ) , (int)( 0.8*h - r ) , r , r ) ;
356 break; 502 break;
357 case 5: 503 case 5:
358 p->drawText( 10,10,"5"); 504 p->drawEllipse( (int)( 0.5*w - r ) , (int)( 0.5*h - r ) , r , r ) ;
505 p->drawEllipse( (int)( 0.2*w - r ) , (int)( 0.2*h - r ) , r , r ) ;
506 p->drawEllipse( (int)( 0.8*w - r ) , (int)( 0.8*h - r ) , r , r ) ;
507 p->drawEllipse( (int)( 0.8*w - r ) , (int)( 0.2*h - r ) , r , r ) ;
508 p->drawEllipse( (int)( 0.2*w - r ) , (int)( 0.8*h - r ) , r , r ) ;
359 break; 509 break;
360 case 6: 510 case 6:
361 p->drawText( 10,10,"6"); 511 p->drawEllipse( (int)( 0.2*w - r ) , (int)( 0.2*h - r ) , r , r ) ;
512 p->drawEllipse( (int)( 0.8*w - r ) , (int)( 0.8*h - r ) , r , r ) ;
513 p->drawEllipse( (int)( 0.8*w - r ) , (int)( 0.2*h - r ) , r , r ) ;
514 p->drawEllipse( (int)( 0.2*w - r ) , (int)( 0.8*h - r ) , r , r ) ;
515 p->drawEllipse( (int)( 0.2*w - r ) , (int)( 0.5*h - r ) , r , r ) ;
516 p->drawEllipse( (int)( 0.8*w - r ) , (int)( 0.5*h - r ) , r , r ) ;
362 break; 517 break;
@@ -396,2 +551,25 @@ Player::Player( QString name )
396 playerName = name; 551 playerName = name;
552 setupResultList();
553 turn = 0;
554}
555
556void Player::setupResultList()
557{
558 for ( int i = 1 ; i < 14 ; ++i )
559 {
560 pResults.append( 0 );
561 }
562}
563
564/*
565 * TODO: muss noch genutzt werden
566 */
567void Player::updateTotalPoints( pointMap m )
568{
569 pointMap::Iterator it = m.begin();
570 for ( ; it != m.end() ; ++it )
571 {
572 totalPoints += it.data();
573 }
574
397} 575}
@@ -399,2 +577,8 @@ Player::Player( QString name )
399 577
578void Player::setResults( const int cat , const int points )
579{
580 QValueListInt::Iterator it = pResults.at( cat );
581 *it = points;
582}
583
400/* 584/*
@@ -406,2 +590,7 @@ Board::Board( QWidget *parent , const char* name ) : QWidget ( parent , name )
406 590
591void Board::mousePressEvent( QMouseEvent *e )
592{
593 emit clicked( e->pos() );
594}
595
407/* 596/*
@@ -420,4 +609,22 @@ void Resultboard::paintEvent( QPaintEvent* )
420 609
421 p.drawText( 10,10, pName ); 610 const int cell_width = this->width();
422 p.drawRect( 0,0, this->width() , this->height() ); 611 const int cell_height = this->height()/17;
612
613 pointMap::Iterator it = pMap.begin();
614 for ( ; it != pMap.end() ; ++it )
615 {
616 int i = it.key();
617 qDebug( "ok: %d , %d" , i , it.data() );
618 p.drawText( 0, i*cell_height , cell_width , cell_height , Qt::AlignCenter , QString::number( it.data() ) );
619 }
620
621 p.drawText( 0,0,cell_width,cell_height, Qt::AlignCenter , pName ); //Playername
622}
623
624
625void Resultboard::updateMap( int item , int points )
626{
627 pMap.insert( item , points );
628
629 update();
423} 630}
@@ -430,14 +637,2 @@ Possibilityboard::Possibilityboard( QWidget *parent , const char* name ) : Board
430{ 637{
431}
432
433void Possibilityboard::paintEvent( QPaintEvent* )
434{
435 QPainter p;
436 p.begin( this );
437
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" ); 638 begriffe.append( "1er" );
@@ -459,26 +654,40 @@ void Possibilityboard::paintEvent( QPaintEvent* )
459 654
460 QStringList::Iterator it = begriffe.begin(); 655 connect( this , SIGNAL( clicked( QPoint ) ), this , SLOT( slotClicked( QPoint ) ) );
656}
461 657
462 for ( int i = 1 ; i < 18 ; ++i ) 658void Possibilityboard::slotClicked( QPoint p)
463 { 659 {
464 p.drawRect( 0 , i*cell_height , cell_width , cell_height ); 660 emit item( p.y()/(this->height()/17) );
465 p.drawText( 0 , i*cell_height , cell_width , cell_height , Qt::AlignCenter , *it );
466 ++it;
467 }
468} 661}
469 662
470/* 663void Possibilityboard::paintEvent( QPaintEvent* )
471 * Game 664{
472 */ 665 QPainter p;
666 p.begin( this );
667
668 const int cell_width = this->width();
669 const int cell_height = this->height()/17;
670
671 p.setBrush( Qt::blue );
473 672
474Game::Game( playerList pla ) 673 QValueListInt::Iterator listIt = list.begin();
674 for ( ; listIt != list.end() ; ++listIt )
475{ 675{
476 players = pla; 676 p.drawRect( 0 , (*listIt) * cell_height , cell_width , cell_height );
477} 677}
478 678
479void Game::startGame() 679 p.setBrush( Qt::black );
480{} 680 p.setBrush( Qt::NoBrush );
681 QStringList::Iterator begriffeIt = begriffe.begin();
682 for ( int i = 1 ; i < 18 ; ++i )
683 {
684 p.drawText( 0 , i*cell_height , cell_width , cell_height , Qt::AlignCenter , *begriffeIt );
685 ++begriffeIt;
686 }
687}
481 688
482void Game::stopGame() 689void Possibilityboard::setIntlist( QValueListInt &l )
483{} 690{
691 list = l;
692}
484 693
diff --git a/noncore/games/oyatzee/oyatzee.h b/noncore/games/oyatzee/oyatzee.h
index 1074f1d..048a733 100644
--- a/noncore/games/oyatzee/oyatzee.h
+++ b/noncore/games/oyatzee/oyatzee.h
@@ -6,2 +6,4 @@
6#include <qlist.h> 6#include <qlist.h>
7#include <qmap.h>
8#include <qsplitter.h>
7 9
@@ -17,2 +19,4 @@ class Player;
17 19
20class QPoint;
21
18typedef QList<Dice> dicesList; 22typedef QList<Dice> dicesList;
@@ -21,2 +25,3 @@ typedef QValueList<int> QValueListInt;
21typedef QList<Player> playerList; 25typedef QList<Player> playerList;
26typedef QMap<int,int> pointMap;
22 27
@@ -28,3 +33,3 @@ class OYatzee : public QMainWindow {
28 33
29 Game *g; 34 Game *g();
30 DiceWidget *dw; 35 DiceWidget *dw;
@@ -33,2 +38,3 @@ class OYatzee : public QMainWindow {
33 QValueListInt posibilities; 38 QValueListInt posibilities;
39 playerList ps;
34 40
@@ -37,4 +43,3 @@ class OYatzee : public QMainWindow {
37 43
38 enum { 44 enum { Ones = 1,
39 Ones=1,
40 Twos = 2, 45 Twos = 2,
@@ -44,9 +49,9 @@ class OYatzee : public QMainWindow {
44 Sixes = 6, 49 Sixes = 6,
45 ThreeOfAKind = 7, //12444 50 ThreeOfAKind = 9, //12444
46 FourOfAKind = 8, //14444 51 FourOfAKind = 10, //14444
47 FullHouse = 9, //22555 52 FullHouse = 11, //22555
48 SStraight = 10, //13456 53 SStraight = 12, //13456
49 LStraight = 11, //12345 54 LStraight = 13, //12345
50 Yatzee = 12, //55555 55 Yatzee = 14, //55555
51 Chance = 13}; 56 Chance = 15};
52 57
@@ -55,2 +60,3 @@ class OYatzee : public QMainWindow {
55 void slotRollDices(); 60 void slotRollDices();
61 void slotEndRound( int );
56 62
@@ -59,2 +65,9 @@ class OYatzee : public QMainWindow {
59 int numOfRounds; 65 int numOfRounds;
66 int currentPlayer; /* the number of the current player */
67
68 int oakPoints;
69
70 void nextPlayer();
71
72 bool lastPlayerFinished;
60 73
@@ -66,2 +79,7 @@ class OYatzee : public QMainWindow {
66 79
80 int getPoints( const int , QValueListInt );
81
82 void startGame();
83 void stopGame();
84
67}; 85};
@@ -74,8 +92,9 @@ class Dice : public QFrame
74 92
75 int Value;
76 bool isSelected; 93 bool isSelected;
77 94
78 int hasValue(); 95 const int hasValue() const;
79 void roll(); 96 void roll();
80 virtual void mousePressEvent( QMouseEvent* ); 97
98 private:
99 int Value;
81 100
@@ -90,2 +109,3 @@ class Dice : public QFrame
90 void paintNumber( QPainter *p ); 109 void paintNumber( QPainter *p );
110 virtual void mousePressEvent( QMouseEvent* );
91}; 111};
@@ -103,3 +123,2 @@ class DiceWidget : public QWidget
103 123
104
105class Board : public QWidget 124class Board : public QWidget
@@ -109,2 +128,9 @@ class Board : public QWidget
109 Board( QWidget *parent = 0, const char* name = 0 ); 128 Board( QWidget *parent = 0, const char* name = 0 );
129
130 signals:
131 void clicked( QPoint );
132 void item( int );
133
134 protected:
135 virtual void mousePressEvent( QMouseEvent* );
110}; 136};
@@ -118,2 +144,14 @@ class Possibilityboard : public Board
118 144
145 QValueListInt list;
146 void setIntlist( QValueListInt& );
147
148 private:
149 QStringList begriffe;
150
151 private slots:
152 /*
153 * this slot returns the item the user has selected
154 */
155 virtual void slotClicked(QPoint);
156
119 protected: 157 protected:
@@ -127,5 +165,9 @@ class Resultboard : public Board
127 public: 165 public:
128 Resultboard( QString playerName , QWidget *parent = 0, const char* name = 0 ); 166 Resultboard( QString playerName = 0 , QWidget *parent = 0, const char* name = 0 );
129 QString pName; 167 QString pName;
130 168
169 pointMap pMap;
170
171 void updateMap( int, int );
172
131 protected: 173 protected:
@@ -147,2 +189,5 @@ class Scoreboard : public QWidget
147 189
190 Resultboard* nextRB(int);
191
192
148 protected: 193 protected:
@@ -159,14 +204,13 @@ class Player
159 int totalPoints; 204 int totalPoints;
160};
161 205
162class Game 206 void setResults( const int , const int );
163{
164 public:
165 Game( playerList pla );
166 207
167 playerList players; 208 int turn;
168 int currentPlayer;
169 209
170 void startGame(); 210 void updateTotalPoints( QMap<int,int> );
171 void stopGame(); 211
212 private:
213 QValueListInt pResults; /* the individual results of the player */
214
215 void setupResultList(); /* only in the ctor */
172}; 216};