1 /* |
|
2 * Hedgewars, a free turn based strategy game |
|
3 * Copyright (c) 2006-2007 Igor Ulyanov <iulyanov@gmail.com> |
|
4 * Copyright (c) 2007-2011 Andrey Korotaev <unC0Rr@gmail.com> |
|
5 * |
|
6 * This program is free software; you can redistribute it and/or modify |
|
7 * it under the terms of the GNU General Public License as published by |
|
8 * the Free Software Foundation; version 2 of the License |
|
9 * |
|
10 * This program is distributed in the hope that it will be useful, |
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 * GNU General Public License for more details. |
|
14 * |
|
15 * You should have received a copy of the GNU General Public License |
|
16 * along with this program; if not, write to the Free Software |
|
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
18 */ |
|
19 |
|
20 #ifndef _TEAM_SELECT_INCLUDED |
|
21 #define _TEAM_SELECT_INCLUDED |
|
22 |
|
23 #include <QGroupBox> |
|
24 #include <QVBoxLayout> |
|
25 #include <QColor> |
|
26 #include <QMultiMap> |
|
27 |
|
28 #include "team.h" |
|
29 |
|
30 class TeamSelWidget; |
|
31 class FrameTeams; |
|
32 class QFrame; |
|
33 class QPushButton; |
|
34 |
|
35 using namespace std; |
|
36 |
|
37 class TeamSelWidget : public QGroupBox |
|
38 { |
|
39 Q_OBJECT |
|
40 |
|
41 public: |
|
42 TeamSelWidget(QWidget* parent); |
|
43 void setAcceptOuter(bool acceptOuter); |
|
44 void removeNetTeam(const HWTeam& team); |
|
45 void resetPlayingTeams(const QList<HWTeam>& teamslist); |
|
46 bool isPlaying(HWTeam team) const; |
|
47 QList<HWTeam> getPlayingTeams() const; |
|
48 QList<HWTeam> getNotPlayingTeams() const; |
|
49 void setInteractivity(bool interactive); |
|
50 |
|
51 public slots: |
|
52 void addTeam(HWTeam team); |
|
53 void netTeamStatusChanged(const HWTeam& team); |
|
54 void changeHHNum(const HWTeam&); |
|
55 void changeTeamColor(const HWTeam&); |
|
56 void changeTeamStatus(HWTeam team); |
|
57 |
|
58 signals: |
|
59 void setEnabledGameStart(bool); |
|
60 void teamWillPlay(HWTeam team); |
|
61 void teamNotPlaying(const HWTeam& team); |
|
62 void hhogsNumChanged(const HWTeam&); |
|
63 void teamColorChanged(const HWTeam&); |
|
64 void acceptRequested(HWTeam team); |
|
65 |
|
66 private slots: |
|
67 void pre_changeTeamStatus(HWTeam); |
|
68 void hhNumChanged(const HWTeam& team); |
|
69 void proxyTeamColorChanged(const HWTeam& team); |
|
70 |
|
71 private: |
|
72 void addScrArea(FrameTeams* pfteams, QColor color, int maxHeight); |
|
73 FrameTeams* frameDontPlaying; |
|
74 FrameTeams* framePlaying; |
|
75 |
|
76 QVBoxLayout mainLayout; |
|
77 bool m_acceptOuter; |
|
78 |
|
79 QList<HWTeam> curPlayingTeams; |
|
80 QList<HWTeam> m_curNotPlayingTeams; |
|
81 }; |
|
82 |
|
83 #endif // _TEAM_SELECT_INCLUDED |
|