Jeux d'echec
Programmation d'un jeux d'echec
 All Classes Files Functions Enumerations Enumerator
mainwindow.h
Go to the documentation of this file.
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3 
4 #include <QMainWindow>
5 #include <QAction>
6 #include <QGridLayout>
7 #include <QMenu>
8 #include <QMenuBar>
9 #include <QMessageBox>
10 #include <QTimer>
11 #include <QtMultimedia/QMediaPlayer>
12 #include <QtMultimedia/QMediaPlaylist>
13 class terrain;
14 #include "terrain.h"
15 
16 class MainWindow : public QMainWindow
17 {
18  Q_OBJECT
19 
20 
21 public:
22  MainWindow(QWidget *parent = 0);
23  ~MainWindow();
24 
25  void addtoScore(enum piece type, int joueur);
26  void updateaffichageall();
27  void setScore(enum piece type,int nb, int joueur);
28  int getTempsrestant();
29  void setTempsrestant(int temps);
30  void resetScore();
31 private slots:
32 
33  void lancerNouvellePartie();
34  void afficherOption();
35  void update_temp_jeux();
36  void SavPartieFichier();
37  void RestaurerPartieFichier();
38  void stopStartSong();
39 
40 private:
41  void initialisation();
42 
43  int temps_restant_partie;
44  QWidget *m_centre;
45  QTimer *m_timer;
46  QLabel *m_label_temps;
47  QLabel *m_afficheur_temps;
48 
49  QLabel *m_label_pionPrisNoir;
50  QLabel *m_label_tourPrisNoir;
51  QLabel *m_label_fouPrisNoir;
52  QLabel *m_label_cavalierPrisNoir;
53  QLabel *m_label_reinePrisNoir;
54 
55  QLabel *m_label_pionPrisBlanc;
56  QLabel *m_label_tourPrisBlanc;
57  QLabel *m_label_fouPrisBlanc;
58  QLabel *m_label_cavalierPrisBlanc;
59  QLabel *m_label_reinePrisBlanc;
60 
61  int m_nb_pionPrisNoir;
62  int m_nb_tourPrisNoir;
63  int m_nb_fouPrisNoir;
64  int m_nb_cavalierPrisNoir;
65  int m_nb_reinePrisNoir;
66 
67  int m_nb_pionPrisBlanc;
68  int m_nb_tourPrisBlanc;
69  int m_nb_fouPrisBlanc;
70  int m_nb_cavalierPrisBlanc;
71  int m_nb_reinePrisBlanc;
72 
73  QHBoxLayout *m_layoutPrincipale;
74  QVBoxLayout *m_layoutScore;
75 
76  QAction *m_menuQuiter;
77  QAction *m_menuNouvellePartie;
78  QAction *m_menuRecommencer;
79  QAction *m_menuOption;
80  QAction *m_sauvegarderPartie;
81  QAction *m_chargerPartie;
82  QAction *m_aboutMenu;
83  QAction *m_stopstartSong;
84  terrain *m_monTerrain;
85  QMediaPlayer *m_player;
86  QMediaPlaylist *m_playlist;
87 };
88 
89 #endif // MAINWINDOW_H