OpenXcom  1.0
Open-source clone of the original X-Com
BattleState.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 "BattlescapeGame.h"
21 
22 namespace OpenXcom
23 {
24 
30 {
31 protected:
32  BattlescapeGame *_parent;
33  BattleAction _action;
34 public:
36  BattleState(BattlescapeGame *parent, BattleAction action);
40  virtual ~BattleState();
42  virtual void init();
44  virtual void cancel();
46  virtual void think();
48  BattleAction getAction() const;
49 };
50 
51 }
Definition: BattlescapeGame.h:43
BattleAction getAction() const
Gets a copy of the action.
Definition: BattleState.cpp:83
virtual ~BattleState()
Cleans up the BattleState.
Definition: BattleState.cpp:49
virtual void cancel()
Handles a cancel request.
Definition: BattleState.cpp:65
This class sets the battlescape in a certain sub-state.
Definition: BattleState.h:29
virtual void think()
Runs state functionality every cycle.
Definition: BattleState.cpp:74
Battlescape game - the core game engine of the battlescape game.
Definition: BattlescapeGame.h:68
virtual void init()
Initializes the state.
Definition: BattleState.cpp:57
BattleState(BattlescapeGame *parent, BattleAction action)
Creates a new BattleState linked to the game.
Definition: BattleState.cpp:29
Definition: BaseInfoState.cpp:40