Skip to content

Commit

Permalink
advanced graphics working
Browse files Browse the repository at this point in the history
  • Loading branch information
OEtzi007 authored and OEtzi007 committed Mar 4, 2014
1 parent 8d3bff4 commit 64cfa53
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
1 change: 0 additions & 1 deletion userinterface/header/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ Q_OBJECT
int gameCounter;
int roundCounter;
int moveCounter;
bool zustandInitialized;
/**
diverse Labels
diverse Combo-/Spin-boxen
Expand Down
3 changes: 0 additions & 3 deletions userinterface/source/spielbrett.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ Spielbrett::Spielbrett(Window* parentalWindow) :
void Spielbrett::paintEvent(QPaintEvent*) {
QPainter painter(this);

if(!parentalWindow->zustandInitialized)
return;

QPixmap background("images/bg2.jpg");
// QPixmap blueCity("images/blau.gif");
// QPixmap greenCity("images/gruen.gif");
Expand Down
26 changes: 14 additions & 12 deletions userinterface/source/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

Window::Window(SimulationLogger *game) :
simulationp(game) {
this->zustandInitialized = false;
town1 = new QLabel(tr("Portland"));
town2 = new QLabel(tr("Sacramento"));
town3 = new QLabel(tr("San Diego"));
Expand All @@ -22,17 +21,19 @@ Window::Window(SimulationLogger *game) :

toolBoxLabel->setFont(font);
gameSpinBox = new QSpinBox;
roundSpinBox = new QSpinBox;
moveSpinBox = new QSpinBox;
showTownsCheckBox = new QCheckBox;
newGameButton = new QPushButton(tr("New Game"));
gameSpinBox->setRange(0, simulationp->gameList.size());
gameSpinBox->setRange(1, simulationp->gameList.size());
gameSpinBox->setWrapping(false);
gameSpinBox->setSuffix(tr(". Spiel"));
roundSpinBox->setRange(0,
simulationp->gameList[gameCounter]->roundList.size());
roundSpinBox->setRange(1,
simulationp->gameList[0]->roundList.size());
roundSpinBox->setWrapping(false);
roundSpinBox->setSuffix(tr(". Runde"));
moveSpinBox->setRange(0,
simulationp->gameList[gameCounter]->roundList[roundCounter]->moveList.size());
moveSpinBox->setRange(1,
simulationp->gameList[0]->roundList[0]->moveList.size());
moveSpinBox->setWrapping(false);
moveSpinBox->setSuffix(tr(". Zug"));
counterLCD = new QLCDNumber;
Expand Down Expand Up @@ -81,24 +82,25 @@ Window::Window(SimulationLogger *game) :
SLOT(drawCityChanged(bool)));
//connect(this, SIGNAL(requestZp(int)), counterLCD, SLOT(display(int)));
//setStyleSheet(" background-color: brown");

setGameCounter(1);
}
/**
Slot-Implementationen
*/
void Window::setZp(State *aktuellerZustand) {
cout << "Aufruf von setZp" << endl;
aZp = aktuellerZustand;
zustandInitialized = true;
spielbrett->update();
}

void Window::setGameCounter(int i) {
gameCounter = i;
gameCounter = i-1;
roundCounter = 0;
moveCounter = 0;
roundSpinBox->setRange(0,
roundSpinBox->setRange(1,
simulationp->gameList[gameCounter]->roundList.size());
moveSpinBox->setRange(0,
moveSpinBox->setRange(1,
simulationp->gameList[gameCounter]->roundList[roundCounter]->moveList.size());
if (simulationp != 0) {
State* currentState = new State(simulationp->board);
Expand All @@ -110,9 +112,9 @@ void Window::setGameCounter(int i) {
}

void Window::setRoundCounter(int i) {
roundCounter = i;
roundCounter = i-1;
moveCounter = 0;
moveSpinBox->setRange(0,
moveSpinBox->setRange(1,
simulationp->gameList[gameCounter]->roundList[roundCounter]->moveList.size());
if (simulationp != 0) {
State* currentState = new State(simulationp->board);
Expand Down

0 comments on commit 64cfa53

Please sign in to comment.