OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
InventoryState.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_INVENTORYSTATE_H
20 #define OPENXCOM_INVENTORYSTATE_H
21 
22 #include "../Engine/State.h"
23 
24 namespace OpenXcom
25 {
26 
27 class Surface;
28 class Text;
29 class InteractiveSurface;
30 class Inventory;
31 class SavedBattleGame;
32 class BattlescapeState;
33 class BattleUnit;
34 
38 class InventoryState : public State
39 {
40 private:
41  Surface *_bg, *_soldier;
42  Text *_txtName, *_txtItem, *_txtAmmo, *_txtWeight, *_txtTus, *_txtFAcc, *_txtReact, *_txtPSkill, *_txtPStr;
43  InteractiveSurface *_btnOk, *_btnPrev, *_btnNext, *_btnUnload, *_btnGround, *_btnRank;
44  Surface *_selAmmo;
45  Inventory *_inv;
46  SavedBattleGame *_battleGame;
47  bool _tu;
48  BattlescapeState *_parent;
49 public:
51  InventoryState(Game *game, bool tu, BattlescapeState *parent);
55  void init();
57  void updateStats();
59  void saveEquipmentLayout();
61  void btnOkClick(Action *action);
63  void btnPrevClick(Action *action);
65  void btnNextClick(Action *action);
67  void btnUnloadClick(Action *action);
69  void btnGroundClick(Action *action);
71  void btnRankClick(Action *action);
73  void invClick(Action *action);
75  void handle(Action *action);
76 };
77 
78 }
79 
80 #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: InventoryState.cpp:432
A game state that receives user input and reacts accordingly.
Definition: State.h:44
void btnGroundClick(Action *action)
Handler for clicking on the Ground -> button.
Definition: InventoryState.cpp:468
Surface that the user can interact with.
Definition: InteractiveSurface.h:39
void invClick(Action *action)
Handler for clicking the Unload button.
Definition: InventoryState.cpp:486
Text string displayed on screen.
Definition: Text.h:41
void btnOkClick(Action *action)
Handler for clicking the OK button.
Definition: InventoryState.cpp:385
void btnPrevClick(Action *action)
Handler for clicking the Previous button.
Definition: InventoryState.cpp:411
void saveEquipmentLayout()
Saves the soldiers' equipment-layout.
Definition: InventoryState.cpp:344
void btnUnloadClick(Action *action)
Handler for clicking the Rank button.
Definition: InventoryState.cpp:453
void init()
Updates all soldier info.
Definition: InventoryState.cpp:213
Interactive view of an inventory.
Definition: Inventory.h:40
Screen which displays soldier's inventory.
Definition: InventoryState.h:38
void btnRankClick(Action *action)
Handler for clicking on the inventory.
Definition: InventoryState.cpp:477
void updateStats()
Updates the soldier info (Weight, TU).
Definition: InventoryState.cpp:301
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
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
Battlescape screen which shows the tactical battle.
Definition: BattlescapeState.h:48
InventoryState(Game *game, bool tu, BattlescapeState *parent)
Creates the Inventory state.
Definition: InventoryState.cpp:61
~InventoryState()
Cleans up the Inventory state.
Definition: InventoryState.cpp:189
void handle(Action *action)
Handles keypresses.
Definition: InventoryState.cpp:543