[2] | 1 | /*programeeropdracht 4 The Nim Game
|
---|
| 2 | *Pascal de Vos (ID = 0446916)
|
---|
| 3 | *Rick van der Zwet (ID = 0433373)
|
---|
| 4 | *file: mainForm.h
|
---|
| 5 | *De header van mainForm.cc, het hoofdprogramma
|
---|
| 6 | */
|
---|
| 7 | #ifndef MAINFORM_H
|
---|
| 8 | #define MAINFORM_H
|
---|
| 9 |
|
---|
| 10 | #include "stapelGroupBox.h"
|
---|
| 11 | #include "nimSpel.h"
|
---|
| 12 | #include <qmainwindow.h>
|
---|
| 13 |
|
---|
| 14 | class QFrame;
|
---|
| 15 | class QLCDNumber;
|
---|
| 16 | class QLabel;
|
---|
| 17 | class QCheckBox;
|
---|
| 18 | class QProgressBar;
|
---|
| 19 | class QSlider;
|
---|
| 20 | class QPushButton;
|
---|
| 21 |
|
---|
| 22 | class MainForm: public QMainWindow
|
---|
| 23 | {
|
---|
| 24 | Q_OBJECT
|
---|
| 25 | public:
|
---|
| 26 | MainForm();
|
---|
| 27 | ~MainForm();
|
---|
| 28 |
|
---|
| 29 | QPopupMenu *optionsMenu;
|
---|
| 30 |
|
---|
| 31 |
|
---|
| 32 | public slots:
|
---|
| 33 | void stapelBoxPressedMinButton( int, int ); //stapelnummer, aantal
|
---|
| 34 |
|
---|
| 35 | private slots:
|
---|
| 36 | void fileNew(); //nieuw spel beginnen
|
---|
| 37 | void fileQuit(); //programma beeindigen
|
---|
| 38 | void helpAbout(); //about venster laten zien
|
---|
| 39 | void helpAboutQt(); //about Qt venster laten zien
|
---|
| 40 | void winnendEnable( int ); //laat winnend venster zien(1) of niet(0)
|
---|
| 41 | void computerZet( ); //computer laten zetten
|
---|
| 42 | void terugZetten( ); //zet beurten terug
|
---|
| 43 | private:
|
---|
| 44 | //private variablen
|
---|
| 45 | StapelGroupBox *stapelBox[MAX_STAPELS]; //keuze spel boxjes
|
---|
| 46 | NimSpel *spelData; //Hier wordt in gerekend en data verwerkt
|
---|
| 47 | int stapelAantal; //Aantal stapel in het spel
|
---|
| 48 | int stokjesMin; //Min aantal stokjes (altijd 0)
|
---|
| 49 | int stokjesMax; //Max aantal stokjes
|
---|
| 50 | int niveauComputer; //Niveau van computer 1=Random, 2=Winnend
|
---|
| 51 |
|
---|
| 52 | int compAantalPakken; //Wat gaat de computer zetten (aantal)
|
---|
| 53 | int compStapelNummer; //(stapel nummer)
|
---|
| 54 |
|
---|
| 55 | //private functies
|
---|
| 56 | void clearBord( int stapelAantalLocal, int stokjesMinLocal,
|
---|
| 57 | int stokjesMaxLocal ); //leeg speelveld
|
---|
| 58 | void computerDialog( bool enabled ); //laat computerkeuze zien
|
---|
| 59 | void createBord( int stapelAantalLocal, int stokjesMinLocal,
|
---|
| 60 | int stokjesMaxLocal ); //maak nieuw spelveld aan
|
---|
| 61 | void winstDialog( int spelerNummer ); //creer output, afhankelijk wie
|
---|
| 62 | //gewonnen heeft
|
---|
| 63 | void updateTerugzetten( ); //ververs vak terugzetten
|
---|
| 64 | void updateStapelBox( int stapelNummer, int aantalPakken,
|
---|
| 65 | int spelerNummer ); //ververs spelveld
|
---|
| 66 | void updateWinnend( ); //werk winnend venster bij
|
---|
| 67 |
|
---|
| 68 | //private grafische onderdelen
|
---|
| 69 | QPopupMenu *fileMenu;
|
---|
| 70 | QPopupMenu *helpMenu;
|
---|
| 71 |
|
---|
| 72 | QFrame* winnendFrame;
|
---|
| 73 | QLCDNumber* winnendAantalLCDNumber;
|
---|
| 74 | QLCDNumber* winnendStapelLCDNumber;
|
---|
| 75 | QLabel* winnendStapelTextLabel;
|
---|
| 76 | QLabel* winnendAantalTextLabel;
|
---|
| 77 | QCheckBox* winnendCheckBox;
|
---|
| 78 |
|
---|
| 79 | QFrame* compDialogFrame;
|
---|
| 80 | QLCDNumber* compDialogStapelLCDNumber;
|
---|
| 81 | QLabel* compDialogStapelTextLabel;
|
---|
| 82 | QLCDNumber* compDialogAantalLCDNumber;
|
---|
| 83 | QLabel* compDialogAantalTextLabel;
|
---|
| 84 | QPushButton* compDialogPushButton;
|
---|
| 85 |
|
---|
| 86 | QFrame* terugzettenFrame;
|
---|
| 87 | QProgressBar* terugzettenProgressBar;
|
---|
| 88 | QLCDNumber* terugzettenLCDNumber;
|
---|
| 89 | QSlider* terugzettenSlider;
|
---|
| 90 | QPushButton* terugzettenPushButton;
|
---|
| 91 |
|
---|
| 92 | };
|
---|
| 93 |
|
---|
| 94 | #endif
|
---|