OpenXcom  1.0
Open-source clone of the original X-Com
MultipleTargetsState.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 "../Engine/State.h"
21 #include <vector>
22 
23 namespace OpenXcom
24 {
25 
26 class TextButton;
27 class Window;
28 class Craft;
29 class Target;
30 class GeoscapeState;
31 
36 {
37 private:
38  static const int MARGIN = 10;
39  static const int SPACING = 4;
40  static const int BUTTON_HEIGHT = 16;
41 
42  std::vector<Target*> _targets;
43  Craft *_craft;
44  GeoscapeState *_state;
45 
46  Window *_window;
47  std::vector<TextButton*> _btnTargets;
48 public:
50  MultipleTargetsState(std::vector<Target*> targets, Craft *craft, GeoscapeState *state);
54  void init();
56  void popupTarget(Target *target);
58  void btnCancelClick(Action *action);
60  void btnTargetClick(Action *action);
61 };
62 
63 }
Represents a craft stored in a base.
Definition: Craft.h:45
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
Geoscape screen which shows an overview of the world and lets the player manage the game...
Definition: GeoscapeState.h:42
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Box with a coloured border and custom background.
Definition: Window.h:40
void init()
Updates the window.
Definition: MultipleTargetsState.cpp:98
Displays a list of possible targets.
Definition: MultipleTargetsState.h:35
MultipleTargetsState(std::vector< Target *> targets, Craft *craft, GeoscapeState *state)
Creates the Multiple Targets state.
Definition: MultipleTargetsState.cpp:47
void btnTargetClick(Action *action)
Handler for clicking the Targets list.
Definition: MultipleTargetsState.cpp:158
~MultipleTargetsState()
Cleans up the Multiple Targets state.
Definition: MultipleTargetsState.cpp:89
Base class for targets on the globe with a set of radian coordinates.
Definition: Target.h:35
void popupTarget(Target *target)
Popup for a target.
Definition: MultipleTargetsState.cpp:114
Definition: BaseInfoState.cpp:40
void btnCancelClick(Action *action)
Handler for clicking the Cancel button.
Definition: MultipleTargetsState.cpp:149