OpenXcom  1.0
Open-source clone of the original X-Com
BaseInfoState.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom 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, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_BASEINFOSTATE_H
20 #define OPENXCOM_BASEINFOSTATE_H
21 
22 #include <cmath>
23 #include "../Engine/State.h"
24 
25 namespace OpenXcom
26 {
27 
28 class BasescapeState;
29 class Base;
30 class Surface;
31 class MiniBaseView;
32 class TextButton;
33 class TextEdit;
34 class Text;
35 class Bar;
36 
41 class BaseInfoState : public State
42 {
43 private:
44  Base *_base;
45  BasescapeState *_state;
46 
47  Surface *_bg;
48  MiniBaseView *_mini;
49  TextButton *_btnOk, *_btnTransfers, *_btnStores, *_btnMonthlyCosts;
50  TextEdit *_edtBase;
51 
52  Text *_txtPersonnel, *_txtSoldiers, *_txtEngineers, *_txtScientists;
53  Text *_numSoldiers, *_numEngineers, *_numScientists;
54  Bar *_barSoldiers, *_barEngineers, *_barScientists;
55 
56  Text *_txtSpace, *_txtQuarters, *_txtStores, *_txtLaboratories, *_txtWorkshops, *_txtContainment, *_txtHangars;
57  Text *_numQuarters, *_numStores, *_numLaboratories, *_numWorkshops, *_numContainment, *_numHangars;
58  Bar *_barQuarters, *_barStores, *_barLaboratories, *_barWorkshops, *_barContainment, *_barHangars;
59 
60  Text *_txtDefense, *_txtShortRange, *_txtLongRange;
61  Text *_numDefense, *_numShortRange, *_numLongRange;
62  Bar *_barDefense, *_barShortRange, *_barLongRange;
63 public:
65  BaseInfoState(Game *game, Base *base, BasescapeState *state);
69  void init();
71  void edtBaseChange(Action *action);
73  void miniClick(Action *action);
75  void handleKeyPress(Action *action);
77  void btnOkClick(Action *action);
79  void btnTransfersClick(Action *action);
81  void btnStoresClick(Action *action);
83  void btnMonthlyCostsClick(Action *action);
84 };
85 
86 }
87 
88 #endif
Container for all the information associated with a given user action, like mouse clicks,...
Definition: Action.h:35
Bar graphic that represents a certain value.
Definition: Bar.h:34
Represents a player base on the globe.
Definition: Base.h:48
Base Info screen that shows all the stats of a base from the Basescape.
Definition: BaseInfoState.h:42
void btnMonthlyCostsClick(Action *action)
Handler for clicking the Monthly Costs button.
Definition: BaseInfoState.cpp:503
void edtBaseChange(Action *action)
Handler for changing the text on the Name edit.
Definition: BaseInfoState.cpp:422
void handleKeyPress(Action *action)
Handler for selecting bases.
Definition: BaseInfoState.cpp:447
void init()
Updates the base stats.
Definition: BaseInfoState.cpp:323
void miniClick(Action *action)
Handler for clicking the mini base view.
Definition: BaseInfoState.cpp:431
void btnStoresClick(Action *action)
Handler for clicking the Stores button.
Definition: BaseInfoState.cpp:494
void btnTransfersClick(Action *action)
Handler for clicking the Transfers button.
Definition: BaseInfoState.cpp:485
~BaseInfoState()
Cleans up the Base Info state.
Definition: BaseInfoState.cpp:315
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: BaseInfoState.cpp:476
BaseInfoState(Game *game, Base *base, BasescapeState *state)
Creates the Base Info state.
Definition: BaseInfoState.cpp:49
Basescape screen that shows a base's layout and lets the player manage their bases.
Definition: BasescapeState.h:40
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:45
Mini view of a base.
Definition: MiniBaseView.h:37
A game state that receives user input and reacts accordingly.
Definition: State.h:45
Element that is blit (rendered) onto the screen.
Definition: Surface.h:40
Coloured button with a text label.
Definition: TextButton.h:41
Editable version of Text.
Definition: TextEdit.h:36
Text string displayed on screen.
Definition: Text.h:42
COPYING:
Definition: BaseInfoState.cpp:41