OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
UnitDieBState.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_UNITDIEBSTATE_H
20 #define OPENXCOM_UNITDIEBSTATE_H
21 
22 #include "BattleState.h"
23 #include "../Ruleset/RuleItem.h"
24 
25 namespace OpenXcom
26 {
27 
28 class BattlescapeGame;
29 class BattleUnit;
30 
31 /* Refactoring tip : UnitDieBState */
35 class UnitDieBState : public BattleState
36 {
37 private:
38  BattleUnit *_unit;
39  ItemDamageType _damageType;
40  bool _noSound;
41  int _originalDir;
42 public:
44  UnitDieBState(BattlescapeGame *parent, BattleUnit *unit, ItemDamageType damageType, bool noSound);
48  void init();
50  void cancel();
52  void think();
54  std::string getResult() const;
56  void convertUnitToCorpse();
58  void playDeathSound();
59 };
60 
61 }
62 
63 #endif
~UnitDieBState()
Cleans up the UnitDieBState.
Definition: UnitDieBState.cpp:100
void convertUnitToCorpse()
Converts a unit to a corpse.
Definition: UnitDieBState.cpp:220
void playDeathSound()
Plays the death sound.
Definition: UnitDieBState.cpp:295
State for dying units.
Definition: UnitDieBState.h:35
This class sets the battlescape in a certain sub-state.
Definition: BattleState.h:34
void think()
Runs state functionality every cycle.
Definition: UnitDieBState.cpp:113
void init()
Initializes the state.
Definition: UnitDieBState.cpp:105
Battlescape game - the core game engine of the battlescape game.
Definition: BattlescapeGame.h:70
UnitDieBState(BattlescapeGame *parent, BattleUnit *unit, ItemDamageType damageType, bool noSound)
Creates a new UnitDieBState class.
Definition: UnitDieBState.cpp:53
std::string getResult() const
Gets the result of the state.
void cancel()
Handles a cancels request.
Definition: UnitDieBState.cpp:213
Represents a moving unit in the battlescape, player controlled or AI controlled it holds info about i...
Definition: BattleUnit.h:58