OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
UnitInfoState.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_UNITINFOSTATE_H
20 #define OPENXCOM_UNITINFOSTATE_H
21 
22 #include "../Engine/State.h"
23 
24 namespace OpenXcom
25 {
26 
27 class BattleUnit;
28 class Text;
29 class TextButton;
30 class Bar;
31 class Surface;
32 class SavedBattleGame;
33 class BattlescapeState;
34 
39 class UnitInfoState : public State
40 {
41 private:
42  SavedBattleGame *_battleGame;
43 
44  BattleUnit *_unit;
45  BattlescapeState *_parent;
46 
47  bool _fromInventory, _mindProbe;
48 
49  Surface *_bg;
50  InteractiveSurface *_exit;
51  Text *_txtName;
52 
53  Text *_txtTimeUnits, *_txtEnergy, *_txtHealth, *_txtFatalWounds, *_txtBravery, *_txtMorale, *_txtReactions, *_txtFiring, *_txtThrowing, *_txtMelee, *_txtStrength;
54  Text *_txtPsiStrength, *_txtPsiSkill;
55  Text *_numTimeUnits, *_numEnergy, *_numHealth, *_numFatalWounds, *_numBravery, *_numMorale, *_numReactions, *_numFiring, *_numThrowing, *_numMelee, *_numStrength;
56  Text *_numPsiStrength, *_numPsiSkill;
57  Bar *_barTimeUnits, *_barEnergy, *_barHealth, *_barFatalWounds, *_barBravery, *_barMorale, *_barReactions, *_barFiring, *_barThrowing, *_barMelee, *_barStrength;
58  Bar *_barPsiStrength, *_barPsiSkill;
59 
60  Text *_txtFrontArmor, *_txtLeftArmor, *_txtRightArmor, *_txtRearArmor, *_txtUnderArmor;
61  Text *_numFrontArmor, *_numLeftArmor, *_numRightArmor, *_numRearArmor, *_numUnderArmor;
62  Bar *_barFrontArmor, *_barLeftArmor, *_barRightArmor, *_barRearArmor, *_barUnderArmor;
63  TextButton *_btnPrev, *_btnNext;
64 public:
66  UnitInfoState(Game *game, BattleUnit *unit, BattlescapeState *parent, bool fromInventory, bool mindProbe);
70  void init();
72  void handle(Action *action);
74  void btnPrevClick(Action *action);
76  void btnNextClick(Action *action);
78  void exitClick(Action *action);
79 };
80 
81 }
82 
83 #endif
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
void btnNextClick(Action *action)
Handler for clicking the Next button.
Definition: UnitInfoState.cpp:676
A game state that receives user input and reacts accordingly.
Definition: State.h:44
~UnitInfoState()
Cleans up the Unit Info state.
Definition: UnitInfoState.cpp:463
Surface that the user can interact with.
Definition: InteractiveSurface.h:39
Text string displayed on screen.
Definition: Text.h:41
Bar graphic that represents a certain value.
Definition: Bar.h:33
Unit Info screen that shows all the info of a specific unit.
Definition: UnitInfoState.h:39
void init()
Updates the unit info.
Definition: UnitInfoState.cpp:472
Coloured button with a text label.
Definition: TextButton.h:40
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
UnitInfoState(Game *game, BattleUnit *unit, BattlescapeState *parent, bool fromInventory, bool mindProbe)
Creates the Unit Info state.
Definition: UnitInfoState.cpp:53
The battlescape data that gets written to disk when the game is saved.
Definition: SavedBattleGame.h:50
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
void handle(Action *action)
Handler for clicking the button.
Definition: UnitInfoState.cpp:627
Battlescape screen which shows the tactical battle.
Definition: BattlescapeState.h:48
void exitClick(Action *action)
Handler for exiting the state.
Definition: UnitInfoState.cpp:701
Represents a moving unit in the battlescape, player controlled or AI controlled it holds info about i...
Definition: BattleUnit.h:58
void btnPrevClick(Action *action)
Handler for clicking the Previous button.
Definition: UnitInfoState.cpp:651