OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ExplosionBState.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_EXPLOSIONBSTATE_H
20 #define OPENXCOM_EXPLOSIONBSTATE_H
21 
22 #include "BattleState.h"
23 #include "Position.h"
24 #include <string>
25 
26 namespace OpenXcom
27 {
28 
29 class BattlescapeGame;
30 class BattleUnit;
31 class BattleItem;
32 class Tile;
33 
39 {
40 private:
41  BattleUnit *_unit;
42  Position _center;
43  BattleItem *_item;
44  Tile *_tile;
45  int _power;
46  bool _areaOfEffect, _lowerWeapon, _pistolWhip;
48  void explode();
49 public:
51  ExplosionBState(BattlescapeGame *parent, Position center, BattleItem *item, BattleUnit *unit, Tile *tile = 0, bool lowerWeapon = false);
55  void init();
57  void cancel();
59  void think();
61  std::string getResult() const;
62 
63 };
64 
65 }
66 
67 #endif
std::string getResult() const
Gets the result of the state.
void cancel()
Handles a cancel request.
Definition: ExplosionBState.cpp:198
Represents a single item in the battlescape.
Definition: BattleItem.h:39
void think()
Runs state functionality every cycle.
Definition: ExplosionBState.cpp:174
This class sets the battlescape in a certain sub-state.
Definition: BattleState.h:34
void init()
Initializes the state.
Definition: ExplosionBState.cpp:70
Basic element of which a battle map is build.
Definition: Tile.h:43
~ExplosionBState()
Cleans up the ExplosionBState.
Definition: ExplosionBState.cpp:60
ExplosionBState(BattlescapeGame *parent, Position center, BattleItem *item, BattleUnit *unit, Tile *tile=0, bool lowerWeapon=false)
Creates a new ExplosionBState class.
Definition: ExplosionBState.cpp:52
Battlescape game - the core game engine of the battlescape game.
Definition: BattlescapeGame.h:70
Explosion state not only handles explosions, but also bullet impacts! Refactoring tip : ImpactBState...
Definition: ExplosionBState.h:38
Easy handling of X-Y-Z coordinates.
Definition: Position.h:30
Represents a moving unit in the battlescape, player controlled or AI controlled it holds info about i...
Definition: BattleUnit.h:58