OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
UnitWalkBState.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_UNITWALKBSTATE_H
20 #define OPENXCOM_UNITWALKBSTATE_H
21 
22 #include <climits>
23 #include "BattleState.h"
24 #include "BattlescapeGame.h"
25 #include "Position.h"
26 
27 namespace OpenXcom
28 {
29 
30 class BattleUnit;
31 class Pathfinding;
32 class TileEngine;
33 
38 {
39 private:
40  Position _target;
41  BattleUnit *_unit;
42  Pathfinding *_pf;
43  TileEngine *_terrain;
44  bool _falling;
45  bool _beforeFirstStep;
47  void postPathProcedures();
49  void setNormalWalkSpeed();
51  void playMovementSound();
52  std::size_t _numUnitsSpotted;
53  int _preMovementCost;
54 public:
60  void setTarget(Position target);
62  void init();
64  void cancel();
66  void think();
67 };
68 
69 }
70 
71 #endif
A utility class that modifies tile properties on a battlescape map.
Definition: TileEngine.h:40
UnitWalkBState(BattlescapeGame *parent, BattleAction _action)
Creates a new UnitWalkBState class.
Definition: UnitWalkBState.cpp:49
Definition: BattlescapeGame.h:45
~UnitWalkBState()
Cleans up the UnitWalkBState.
Definition: UnitWalkBState.cpp:57
void init()
Initializes the state.
Definition: UnitWalkBState.cpp:65
void cancel()
Handles a cancels request.
Definition: UnitWalkBState.cpp:462
void setTarget(Position target)
Sets the target to walk to.
This class sets the battlescape in a certain sub-state.
Definition: BattleState.h:34
State for walking units.
Definition: UnitWalkBState.h:37
Battlescape game - the core game engine of the battlescape game.
Definition: BattlescapeGame.h:70
A utility class that calculates the shortest path between two points on the battlescape map...
Definition: Pathfinding.h:37
Easy handling of X-Y-Z coordinates.
Definition: Position.h:30
void think()
Runs state functionality every cycle.
Definition: UnitWalkBState.cpp:84
Represents a moving unit in the battlescape, player controlled or AI controlled it holds info about i...
Definition: BattleUnit.h:58