Viergewinnt (four-in-a-row) implementation in c++ and QT
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

newgame.h 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* VierGewinnt - A simple 4-in-a-row network game
  2. *
  3. * Copyright (c) 2008 by Sebastian Lohff, seba@seba-geek.de
  4. * http://www.seba-geek.de
  5. *
  6. * This file is part of VierGewinnt.
  7. *
  8. * VierGewinnt is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 2 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * VierGewinnt is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with VierGewinnt. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #ifndef __NEWGAME_H
  22. #define __NEWGAME_H
  23. #include <QDialog>
  24. #include <QLabel>
  25. #include <QPushButton>
  26. #include <QVBoxLayout>
  27. #include <QHBoxLayout>
  28. #include <QTcpSocket>
  29. #include <QTextStream>
  30. class NewGameDialog : public QDialog {
  31. Q_OBJECT
  32. public:
  33. NewGameDialog(QTcpSocket *sock, QWidget *parent=0);
  34. void reset(bool won);
  35. void netPlayerAck();
  36. private slots:
  37. void localAck();
  38. void closeGame();
  39. private:
  40. QVBoxLayout *layout;
  41. QHBoxLayout *buttonrow;
  42. QLabel *gameend;
  43. QLabel *newgame;
  44. QLabel *netplayer;
  45. QPushButton *ok;
  46. QPushButton *cancel;
  47. QTcpSocket *mysock;
  48. bool myack, youack;
  49. };
  50. #endif