33
44Window::Window (SimulationLogger *game) :
55 simulationp(game) {
6- this ->zustandInitialized = false ;
76 town1 = new QLabel (tr (" Portland" ));
87 town2 = new QLabel (tr (" Sacramento" ));
98 town3 = new QLabel (tr (" San Diego" ));
@@ -22,17 +21,19 @@ Window::Window(SimulationLogger *game) :
2221
2322 toolBoxLabel->setFont (font);
2423 gameSpinBox = new QSpinBox;
24+ roundSpinBox = new QSpinBox;
25+ moveSpinBox = new QSpinBox;
2526 showTownsCheckBox = new QCheckBox;
2627 newGameButton = new QPushButton (tr (" New Game" ));
27- gameSpinBox->setRange (0 , simulationp->gameList .size ());
28+ gameSpinBox->setRange (1 , simulationp->gameList .size ());
2829 gameSpinBox->setWrapping (false );
2930 gameSpinBox->setSuffix (tr (" . Spiel" ));
30- roundSpinBox->setRange (0 ,
31- simulationp->gameList [gameCounter ]->roundList .size ());
31+ roundSpinBox->setRange (1 ,
32+ simulationp->gameList [0 ]->roundList .size ());
3233 roundSpinBox->setWrapping (false );
3334 roundSpinBox->setSuffix (tr (" . Runde" ));
34- moveSpinBox->setRange (0 ,
35- simulationp->gameList [gameCounter ]->roundList [roundCounter ]->moveList .size ());
35+ moveSpinBox->setRange (1 ,
36+ simulationp->gameList [0 ]->roundList [0 ]->moveList .size ());
3637 moveSpinBox->setWrapping (false );
3738 moveSpinBox->setSuffix (tr (" . Zug" ));
3839 counterLCD = new QLCDNumber;
@@ -81,24 +82,25 @@ Window::Window(SimulationLogger *game) :
8182 SLOT (drawCityChanged (bool )));
8283 // connect(this, SIGNAL(requestZp(int)), counterLCD, SLOT(display(int)));
8384 // setStyleSheet(" background-color: brown");
85+
86+ setGameCounter (1 );
8487}
8588/* *
8689 Slot-Implementationen
8790 */
8891void Window::setZp (State *aktuellerZustand) {
8992 cout << " Aufruf von setZp" << endl;
9093 aZp = aktuellerZustand;
91- zustandInitialized = true ;
9294 spielbrett->update ();
9395}
9496
9597void Window::setGameCounter (int i) {
96- gameCounter = i;
98+ gameCounter = i- 1 ;
9799 roundCounter = 0 ;
98100 moveCounter = 0 ;
99- roundSpinBox->setRange (0 ,
101+ roundSpinBox->setRange (1 ,
100102 simulationp->gameList [gameCounter]->roundList .size ());
101- moveSpinBox->setRange (0 ,
103+ moveSpinBox->setRange (1 ,
102104 simulationp->gameList [gameCounter]->roundList [roundCounter]->moveList .size ());
103105 if (simulationp != 0 ) {
104106 State* currentState = new State (simulationp->board );
@@ -110,9 +112,9 @@ void Window::setGameCounter(int i) {
110112}
111113
112114void Window::setRoundCounter (int i) {
113- roundCounter = i;
115+ roundCounter = i- 1 ;
114116 moveCounter = 0 ;
115- moveSpinBox->setRange (0 ,
117+ moveSpinBox->setRange (1 ,
116118 simulationp->gameList [gameCounter]->roundList [roundCounter]->moveList .size ());
117119 if (simulationp != 0 ) {
118120 State* currentState = new State (simulationp->board );
0 commit comments