OpenXcom  1.0
Open-source clone of the original X-Com
UnitInfoState.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include "../Engine/State.h"
21 
22 namespace OpenXcom
23 {
24 
25 class BattleUnit;
26 class Text;
27 class TextButton;
28 class Bar;
29 class Surface;
30 class SavedBattleGame;
31 class BattlescapeState;
32 
37 class UnitInfoState : public State
38 {
39 private:
40  SavedBattleGame *_battleGame;
41 
42  BattleUnit *_unit;
43  BattlescapeState *_parent;
44 
45  bool _fromInventory, _mindProbe;
46 
47  Surface *_bg;
48  InteractiveSurface *_exit;
49  Text *_txtName;
50 
51  Text *_txtTimeUnits, *_txtEnergy, *_txtHealth, *_txtFatalWounds, *_txtBravery, *_txtMorale, *_txtReactions, *_txtFiring, *_txtThrowing, *_txtMelee, *_txtStrength;
52  Text *_txtPsiStrength, *_txtPsiSkill;
53  Text *_numTimeUnits, *_numEnergy, *_numHealth, *_numFatalWounds, *_numBravery, *_numMorale, *_numReactions, *_numFiring, *_numThrowing, *_numMelee, *_numStrength;
54  Text *_numPsiStrength, *_numPsiSkill;
55  Bar *_barTimeUnits, *_barEnergy, *_barHealth, *_barFatalWounds, *_barBravery, *_barMorale, *_barReactions, *_barFiring, *_barThrowing, *_barMelee, *_barStrength;
56  Bar *_barPsiStrength, *_barPsiSkill;
57 
58  Text *_txtFrontArmor, *_txtLeftArmor, *_txtRightArmor, *_txtRearArmor, *_txtUnderArmor;
59  Text *_numFrontArmor, *_numLeftArmor, *_numRightArmor, *_numRearArmor, *_numUnderArmor;
60  Bar *_barFrontArmor, *_barLeftArmor, *_barRightArmor, *_barRearArmor, *_barUnderArmor;
61  TextButton *_btnPrev, *_btnNext;
62 public:
64  UnitInfoState(BattleUnit *unit, BattlescapeState *parent, bool fromInventory, bool mindProbe);
68  void init();
70  void handle(Action *action);
72  void btnPrevClick(Action *action);
74  void btnNextClick(Action *action);
76  void exitClick(Action *action);
77 };
78 
79 }
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
void btnNextClick(Action *action)
Handler for clicking the Next button.
Definition: UnitInfoState.cpp:654
A game state that receives user input and reacts accordingly.
Definition: State.h:44
~UnitInfoState()
Cleans up the Unit Info state.
Definition: UnitInfoState.cpp:441
Surface that the user can interact with.
Definition: InteractiveSurface.h:37
Text string displayed on screen.
Definition: Text.h:40
Bar graphic that represents a certain value.
Definition: Bar.h:31
Unit Info screen that shows all the info of a specific unit.
Definition: UnitInfoState.h:37
void init()
Updates the unit info.
Definition: UnitInfoState.cpp:450
Coloured button with a text label.
Definition: TextButton.h:38
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
The battlescape data that gets written to disk when the game is saved.
Definition: SavedBattleGame.h:47
UnitInfoState(BattleUnit *unit, BattlescapeState *parent, bool fromInventory, bool mindProbe)
Creates the Unit Info state.
Definition: UnitInfoState.cpp:50
void handle(Action *action)
Handler for clicking the button.
Definition: UnitInfoState.cpp:605
Battlescape screen which shows the tactical battle.
Definition: BattlescapeState.h:47
void exitClick(Action *action)
Handler for exiting the state.
Definition: UnitInfoState.cpp:679
Represents a moving unit in the battlescape, player controlled or AI controlled it holds info about i...
Definition: BattleUnit.h:59
Definition: BaseInfoState.cpp:40
void btnPrevClick(Action *action)
Handler for clicking the Previous button.
Definition: UnitInfoState.cpp:629