2 Copyright Russell Steffen <rsteffen@bayarea.net>
3 Copyright Stephan Zehetner <s.zehetner@nevox.org>
4 Copyright Dmitry Suzdalev <dimsuz@gmail.com>
5 Copyright <inge@lysator.liu.se>
6 Copyright <pinaraf@gmail.com>
8 This program 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.
13 This program 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.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
32 //************************************************************************
33 // forward declarations
34 //************************************************************************
42 class KLocalizedString
;
67 //************************************************************************
69 //************************************************************************
72 class GameView
: public QWidget
77 explicit GameView( QWidget
*parent
, GameLogic
*gameLogic
);
80 // virtual QSize sizeHint() const;
82 bool isGameInProgress() const { return m_gameInProgress
; }
87 void planetSelected( Planet
* );
91 //***************************************************************
93 //***************************************************************
94 void measureDistance();
99 void gameMsg(const KLocalizedString
&msg
, Player
*player
= 0,
100 Planet
*planet
= 0, Player
*planetPlayer
= 0);
105 void newGUIState( GUIState newState
);
107 //***************************************************************
109 //***************************************************************
111 virtual void keyPressEvent( QKeyEvent
* );
112 virtual void resizeEvent ( QResizeEvent
* event
);
118 void sendAttackFleet( Planet
*source
, Planet
*dest
, int ships
);
120 void changeGameView( bool inPlay
);
124 //***************************************************************
126 //***************************************************************
128 MapView
*m_mapWidget
;
129 MapScene
*m_mapScene
;
130 QLabel
*m_gameMessage
;
131 QPushButton
*m_endTurnBtn
;
132 QLineEdit
*m_shipCountEdit
;
133 QLabel
*m_splashScreen
;
134 QTextEdit
*m_msgWidget
;
136 //***************************************************************
138 //***************************************************************
140 GameLogic
*m_gameLogic
;
142 Player
*m_neutralPlayer
; // FIXME: Have here or in gamelogic?
143 bool m_queueMessages
;
144 QList
<GameMessage
> m_messageQueue
;
145 bool m_showInformations
;
147 // States in the user interaction
148 // FIXME: Break out into another file?
149 bool haveSourcePlanet
;
150 Planet
*sourcePlanet
;
158 //***************************************************************
159 // Game State information
160 //***************************************************************
162 bool m_gameInProgress
;