Skip to content

Commit 64cfa53

Browse files
OEtzi007OEtzi007
authored andcommitted
advanced graphics working
1 parent 8d3bff4 commit 64cfa53

3 files changed

Lines changed: 14 additions & 16 deletions

File tree

userinterface/header/window.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ Q_OBJECT
3131
int gameCounter;
3232
int roundCounter;
3333
int moveCounter;
34-
bool zustandInitialized;
3534
/**
3635
diverse Labels
3736
diverse Combo-/Spin-boxen

userinterface/source/spielbrett.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ Spielbrett::Spielbrett(Window* parentalWindow) :
5656
void Spielbrett::paintEvent(QPaintEvent*) {
5757
QPainter painter(this);
5858

59-
if(!parentalWindow->zustandInitialized)
60-
return;
61-
6259
QPixmap background("images/bg2.jpg");
6360
// QPixmap blueCity("images/blau.gif");
6461
// QPixmap greenCity("images/gruen.gif");

userinterface/source/window.cpp

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
Window::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
*/
8891
void Window::setZp(State *aktuellerZustand) {
8992
cout << "Aufruf von setZp" << endl;
9093
aZp = aktuellerZustand;
91-
zustandInitialized = true;
9294
spielbrett->update();
9395
}
9496

9597
void 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

112114
void 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

Comments
 (0)