OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
SoldierInfoState.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_SOLDIERINFOSTATE_H
20 #define OPENXCOM_SOLDIERINFOSTATE_H
21 
22 #include "../Engine/State.h"
23 #include <vector>
24 
25 namespace OpenXcom
26 {
27 
28 class Base;
29 class Surface;
30 class TextButton;
31 class Text;
32 class TextEdit;
33 class Bar;
34 class Soldier;
35 
40 class SoldierInfoState : public State
41 {
42 private:
43  Base *_base;
44  size_t _soldierId;
45  Soldier *_soldier;
46  std::vector<Soldier*> *_list;
47 
48  Surface *_bg, *_rank;
49  TextButton *_btnOk, *_btnPrev, *_btnNext, *_btnArmor, *_btnSack;
50  Text *_txtRank, *_txtMissions, *_txtKills, *_txtCraft, *_txtRecovery, *_txtPsionic;
51  TextEdit *_edtSoldier;
52 
53  Text *_txtTimeUnits, *_txtStamina, *_txtHealth, *_txtBravery, *_txtReactions, *_txtFiring, *_txtThrowing, *_txtMelee, *_txtStrength, *_txtPsiStrength, *_txtPsiSkill;
54  Text *_numTimeUnits, *_numStamina, *_numHealth, *_numBravery, *_numReactions, *_numFiring, *_numThrowing, *_numMelee, *_numStrength, *_numPsiStrength, *_numPsiSkill;
55  Bar *_barTimeUnits, *_barStamina, *_barHealth, *_barBravery, *_barReactions, *_barFiring, *_barThrowing, *_barMelee, *_barStrength, *_barPsiStrength, *_barPsiSkill;
56 public:
58  SoldierInfoState(Game *game, Base *base, size_t soldierId);
62  void init();
64  void edtSoldierPress(Action *action);
66  void edtSoldierChange(Action *action);
68  void btnOkClick(Action *action);
70  void btnPrevClick(Action *action);
72  void btnNextClick(Action *action);
74  void btnArmorClick(Action *action);
76  void btnSackClick(Action *action);
77 };
78 
79 }
80 
81 #endif
SoldierInfoState(Game *game, Base *base, size_t soldierId)
Creates the Soldier Info state.
Definition: SoldierInfoState.cpp:55
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: SoldierInfoState.cpp:607
A game state that receives user input and reacts accordingly.
Definition: State.h:44
void btnArmorClick(Action *action)
Handler for clicking the Armor button.
Definition: SoldierInfoState.cpp:646
void btnNextClick(Action *action)
Handler for clicking the Next button.
Definition: SoldierInfoState.cpp:634
Text string displayed on screen.
Definition: Text.h:41
Bar graphic that represents a certain value.
Definition: Bar.h:33
void btnPrevClick(Action *action)
Handler for clicking the Previous button.
Definition: SoldierInfoState.cpp:621
void edtSoldierChange(Action *action)
Handler for changing text on the Name edit.
Definition: SoldierInfoState.cpp:598
void init()
Updates the soldier info.
Definition: SoldierInfoState.cpp:400
Represents a soldier hired by the player.
Definition: Soldier.h:49
Represents a player base on the globe.
Definition: Base.h:47
~SoldierInfoState()
Cleans up the Soldier Info state.
Definition: SoldierInfoState.cpp:391
Coloured button with a text label.
Definition: TextButton.h:40
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
Soldier Info screen that shows all the info of a specific soldier.
Definition: SoldierInfoState.h:40
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
Editable version of Text.
Definition: TextEdit.h:35
void btnSackClick(Action *action)
Handler for clicking the Sack button.
Definition: SoldierInfoState.cpp:658
void edtSoldierPress(Action *action)
Handler for pressing on the Name edit.
Definition: SoldierInfoState.cpp:586