Warning, file /games/ksirk/ksirk/krightdialog.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* This file is part of KsirK. 0002 Copyright (C) 2008 Gael Clouet <pelouas@hotmail.fr> 0003 0004 KsirK is free software; you can redistribute it and/or 0005 modify it under the terms of the GNU General Public 0006 License as published by the Free Software Foundation, either version 2 0007 of the License, or (at your option) any later version. 0008 0009 This program is distributed in the hope that it will be useful, 0010 but WITHOUT ANY WARRANTY; without even the implied warranty of 0011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0012 General Public License for more details. 0013 0014 You should have received a copy of the GNU General Public License 0015 along with this program; if not, write to the Free Software 0016 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 0017 02110-1301, USA 0018 */ 0019 0020 /* begin : Thu Jan 17 2008 */ 0021 0022 0023 #ifndef KRIGHTDIALOG_H 0024 #define KRIGHTDIALOG_H 0025 0026 #include "KsirkGlobalDefinitions.h" 0027 0028 #include "GameLogic/onu.h" 0029 #include "GameLogic/country.h" 0030 #include "GameLogic/player.h" 0031 #include <stdlib.h> 0032 #include <QGroupBox> 0033 #include <QGridLayout> 0034 #include <QPointF> 0035 #include <QDockWidget> 0036 #include <QList> 0037 #include <QLabel> 0038 #include <KConfig> 0039 #include <KConfigGroup> 0040 #include <QPushButton> 0041 0042 #include "kgamewin.h" 0043 namespace Ksirk 0044 { 0045 class KGameWindow; 0046 namespace GameLogic 0047 { 0048 class ONU; 0049 class Country; 0050 } 0051 /** 0052 * The KRightDialog class is the widget displayed on the right of 0053 * the application 0054 */ 0055 class KRightDialog: public QWidget 0056 { 0057 Q_OBJECT 0058 0059 public: 0060 /** 0061 * Creates the group box which will contains the needed widgets 0062 */ 0063 KRightDialog(QDockWidget * parent,GameLogic::ONU * world,KGameWindow* m_game); 0064 0065 /** 0066 * Destroy the widget 0067 */ 0068 ~KRightDialog() override; 0069 0070 /** 0071 * Display the country information after a right click mouse 0072 * @param contryPoint which is the point clicked 0073 */ 0074 void displayCountryDetails(const QPointF& countryPoint); 0075 0076 /** 0077 * Display the fight details 0078 */ 0079 void displayFightDetails(GameLogic::Country * attaker, GameLogic::Country * defender,int nb_A, int nb_D); 0080 0081 /** 0082 * Display information about the recycling processus 0083 * @param player which we want to see information 0084 */ 0085 void displayRecycleDetails(GameLogic::Player* player, int nbAvailArmies); 0086 0087 /** 0088 * Update information about the recycling processus 0089 * @param country country which gives his information 0090 * @param recyclePhase shows if we are in recycle phase or not 0091 */ 0092 void updateRecycleDetails(GameLogic::Country* country, bool recyclePhase, int nbAvailArmies); 0093 0094 /** 0095 * Display the dice 0096 */ 0097 void displayFightResult(int A1, int A2, int A3, int D1, int D2,int nbA,int nbD, bool win); 0098 0099 void initListLabel(int i); 0100 0101 void removeListLabel(); 0102 0103 void clearLabel(); 0104 0105 void clearLayout() ; 0106 0107 inline void close() {m_parentWidget->hide();}; 0108 0109 inline void open() {m_parentWidget->show();}; 0110 0111 inline bool isOpen() {return m_parentWidget->isVisible();}; 0112 0113 private: 0114 0115 QGridLayout * mainLayout; 0116 0117 QLabel * loadingLabel; 0118 0119 QLabel *infoProcess; 0120 0121 QDockWidget * m_parentWidget; 0122 0123 Ksirk::GameLogic::ONU * world; 0124 0125 QList<QLabel*> rightContents; 0126 0127 QLabel * flag1; 0128 0129 QLabel * flag2; 0130 0131 QWidget * bas; 0132 0133 QWidget * haut; 0134 0135 QWidget * milieu; 0136 0137 QWidget * milieu2; 0138 0139 // Widgets and buttons used in displayRecycleDetails 0140 QWidget * btRecycleWidget; 0141 0142 QWidget * btValidWidget; 0143 0144 // images for buttons 0145 QPixmap soldat; 0146 QPixmap stopAttackAuto; 0147 QPixmap recycleContinue; 0148 QPixmap recycleDone; 0149 QPixmap recycleNextPlayer; 0150 0151 KGameWindow * game; 0152 0153 QPushButton* buttonStopAttack; 0154 QPushButton* buttonStopDefense; 0155 0156 private slots: 0157 0158 void slotStopAttackAuto(); 0159 void slotStopDefenseAuto(); 0160 0161 }; 0162 0163 } 0164 0165 #endif // KRIGHTDIALOG_H