OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MiniBaseView.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_MINIBASEVIEW_H
20 #define OPENXCOM_MINIBASEVIEW_H
21 
22 #include <vector>
23 #include "../Engine/InteractiveSurface.h"
24 
25 namespace OpenXcom
26 {
27 
28 class Base;
29 class SurfaceSet;
30 
37 {
38 private:
39  static const int MINI_SIZE = 14;
40 
41  std::vector<Base*> *_bases;
42  SurfaceSet *_texture;
43  size_t _base, _hoverBase;
44 public:
45  static const size_t MAX_BASES = 8;
47  MiniBaseView(int width, int height, int x = 0, int y = 0);
49  ~MiniBaseView();
51  void setBases(std::vector<Base*> *bases);
53  void setTexture(SurfaceSet *texture);
55  size_t getHoveredBase() const;
57  void setSelectedBase(size_t base);
59  void draw();
61  void mouseOver(Action *action, State *state);
62 };
63 
64 }
65 
66 #endif
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:34
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Surface that the user can interact with.
Definition: InteractiveSurface.h:39
void setSelectedBase(size_t base)
Sets the selected base for the mini base view.
Definition: MiniBaseView.cpp:84
void setTexture(SurfaceSet *texture)
Sets the texture for the mini base view.
Definition: MiniBaseView.cpp:65
void mouseOver(Action *action, State *state)
Special handling for mouse hovers.
Definition: MiniBaseView.cpp:158
void setBases(std::vector< Base * > *bases)
Sets the base list to display.
Definition: MiniBaseView.cpp:54
Container of a set of surfaces.
Definition: SurfaceSet.h:38
void draw()
Draws the mini base view.
Definition: MiniBaseView.cpp:94
MiniBaseView(int width, int height, int x=0, int y=0)
Creates a new mini base view at the specified position and size.
Definition: MiniBaseView.cpp:39
size_t getHoveredBase() const
Gets the base the mouse is over.
Definition: MiniBaseView.cpp:74
Mini view of a base.
Definition: MiniBaseView.h:36
~MiniBaseView()
Cleans up the mini base view.
Definition: MiniBaseView.cpp:46