OpenXcom  1.0
Open-source clone of the original X-Com
Explosion.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include "Position.h"
21 
22 namespace OpenXcom
23 {
24 
29 class Explosion
30 {
31 private:
32  Position _position;
33  int _currentFrame, _startFrame, _frameDelay;
34  bool _big, _hit;
35 public:
36  static const int HIT_FRAMES;
37  static const int EXPLODE_FRAMES;
38  static const int BULLET_FRAMES;
40  Explosion(Position _position, int startFrame, int frameDelay = 0, bool big = false, bool hit = false);
42  ~Explosion();
44  bool animate();
46  Position getPosition() const;
48  int getCurrentFrame() const;
50  bool isBig() const;
52  bool isHit() const;
53 };
54 
55 }
bool isBig() const
Checks if this is a real explosion.
Definition: Explosion.cpp:96
Position getPosition() const
Gets the current position in voxel space.
Definition: Explosion.cpp:76
int getCurrentFrame() const
Gets the current frame.
Definition: Explosion.cpp:85
Explosion(Position _position, int startFrame, int frameDelay=0, bool big=false, bool hit=false)
Creates a new Explosion.
Definition: Explosion.cpp:34
A class that represents an explosion animation.
Definition: Explosion.h:29
bool isHit() const
Checks if this is a melee or psi hit.
Definition: Explosion.cpp:105
Easy handling of X-Y-Z coordinates.
Definition: Position.h:28
~Explosion()
Cleans up the Explosion.
Definition: Explosion.cpp:42
bool animate()
Moves the Explosion on one frame.
Definition: Explosion.cpp:51
Definition: BaseInfoState.cpp:40