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 
36 /**
37  * Soldier Info screen that shows all the
38  * info of a specific soldier.
39  */
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:
57 	/// Creates the Soldier Info state.
58 	SoldierInfoState(Game *game, Base *base, size_t soldierId);
59 	/// Cleans up the Soldier Info state.
60 	~SoldierInfoState();
61 	/// Updates the soldier info.
62 	void init();
63 	/// Handler for pressing on the Name edit.
64 	void edtSoldierPress(Action *action);
65 	/// Handler for changing text on the Name edit.
66 	void edtSoldierChange(Action *action);
67 	/// Handler for clicking the OK button.
68 	void btnOkClick(Action *action);
69 	/// Handler for clicking the Previous button.
70 	void btnPrevClick(Action *action);
71 	/// Handler for clicking the Next button.
72 	void btnNextClick(Action *action);
73 	/// Handler for clicking the Armor button.
74 	void btnArmorClick(Action *action);
75 	/// Handler for clicking the Sack button.
76 	void btnSackClick(Action *action);
77 };
78 
79 }
80 
81 #endif
82