summaryrefslogtreecommitdiffstats
path: root/pacman-c++/mainwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/mainwidget.cpp')
-rw-r--r--pacman-c++/mainwidget.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/pacman-c++/mainwidget.cpp b/pacman-c++/mainwidget.cpp
index 743b57e..e9b4cc3 100644
--- a/pacman-c++/mainwidget.cpp
+++ b/pacman-c++/mainwidget.cpp
@@ -11,21 +11,21 @@ MainWidget::MainWidget()
11 setFocusPolicy(Qt::StrongFocus); 11 setFocusPolicy(Qt::StrongFocus);
12 12
13 QVBoxLayout *layout = new QVBoxLayout(this); 13 QVBoxLayout *layout = new QVBoxLayout(this);
14
15 QHBoxLayout *m_scoreLayout = new QHBoxLayout(); 14 QHBoxLayout *m_scoreLayout = new QHBoxLayout();
16 15
17 for (unsigned int i=1; i<4; ++i) { 16 for (unsigned int i = 1; i < 4; ++i)
17 {
18 QGroupBox *scoreBoxI = new QGroupBox(QString("Spieler %1").arg(i), this); 18 QGroupBox *scoreBoxI = new QGroupBox(QString("Spieler %1").arg(i), this);
19 m_scoreLayout->addWidget(scoreBoxI); 19 m_scoreLayout->addWidget(scoreBoxI);
20 20
21 QGridLayout *playerLayout = new QGridLayout(); 21 QGridLayout *playerLayout = new QGridLayout();
22 scoreBoxI->setLayout(playerLayout); 22 scoreBoxI->setLayout(playerLayout);
23 23
24 playerLayout->addWidget( new QLabel("Rundenpunkte:", this), 0, 0); 24 playerLayout->addWidget(new QLabel("Rundenpunkte:", this), 0, 0);
25 playerLayout->addWidget( new QLabel("Gesamtpunkte:", this), 1, 0); 25 playerLayout->addWidget(new QLabel("Gesamtpunkte:", this), 1, 0);
26 26
27 playerLayout->addWidget( new QLabel("", this), 0, 1); 27 playerLayout->addWidget(new QLabel("", this), 0, 1);
28 playerLayout->addWidget( new QLabel("", this), 1, 1); 28 playerLayout->addWidget(new QLabel("", this), 1, 1);
29 29
30 m_playerScoreLayouts.append(playerLayout); 30 m_playerScoreLayouts.append(playerLayout);
31 } 31 }
@@ -50,7 +50,7 @@ MainWidget::MainWidget()
50 50
51void MainWidget::updateScore() 51void MainWidget::updateScore()
52{ 52{
53 QMapIterator<Color, Actor*> i(m_actors); 53 QMapIterator<Color::Color, Actor*> i(m_actors);
54 while (i.hasNext()) { 54 while (i.hasNext()) {
55 i.next(); 55 i.next();
56 int id = i.key() - 1; 56 int id = i.key() - 1;
@@ -83,19 +83,21 @@ transmission::map_t createDummyMap()
83 } 83 }
84 } 84 }
85 85
86 map[4][3] |= green; 86 map[0][0] |= Color::none ^ transmission::block;
87 map[4][3] |= transmission::block; 87 map[0][1] |= Color::none ^ transmission::block;
88 map[0][2] |= Color::none ^ transmission::block;
89 map[1][0] |= Color::none ^ transmission::block;
90 map[2][0] |= Color::none ^ transmission::block;
91
92 map[4][3] |= Color::green ^ transmission::block;
88 93
89 map[5][3] |= noColor; 94 map[5][3] |= Color::none ^ transmission::block;
90 map[5][3] |= transmission::block; 95 map[6][3] |= Color::none ^ transmission::block;
91 map[6][3] |= noColor; 96 map[7][3] |= Color::red ^ transmission::block;
92 map[6][3] |= transmission::block;
93 map[7][3] |= red;
94 map[7][3] |= transmission::block;
95 97
96 map[7][5] |= transmission::bonuspoint; 98 map[7][5] |= transmission::bonuspoint;
97 99
98 map[5][5] |= blue; 100 map[5][5] |= Color::blue;
99 map[5][5] |= transmission::pacman; 101 map[5][5] |= transmission::pacman;
100 map[5][5] |= transmission::direction_left; 102 map[5][5] |= transmission::direction_left;
101 103
@@ -115,7 +117,7 @@ void MainWidget::loadDummyMap()
115 continue; 117 continue;
116 qDebug() << "not 0 at x=" << x << ", y=" << y << ", val=" << cur; 118 qDebug() << "not 0 at x=" << x << ", y=" << y << ", val=" << cur;
117 119
118 Color color = static_cast<Color>(cur & transmission::color_mask); 120 Color::Color color = static_cast<Color::Color>(cur & transmission::color_mask);
119 qDebug() << "col=" << color; 121 qDebug() << "col=" << color;
120 122
121 PixmapItem *item = 0; 123 PixmapItem *item = 0;