OpenXcom  1.0
Open-source clone of the original X-Com
MiniBaseView.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 <vector>
21 #include "../Engine/InteractiveSurface.h"
22 
23 namespace OpenXcom
24 {
25 
26 class Base;
27 class SurfaceSet;
28 
35 {
36 private:
37  static const int MINI_SIZE = 14;
38 
39  std::vector<Base*> *_bases;
40  SurfaceSet *_texture;
41  size_t _base, _hoverBase;
42  Uint8 _red, _green;
43 public:
44  static const size_t MAX_BASES = 8;
46  MiniBaseView(int width, int height, int x = 0, int y = 0);
48  ~MiniBaseView();
50  void setBases(std::vector<Base*> *bases);
52  void setTexture(SurfaceSet *texture);
54  size_t getHoveredBase() const;
56  void setSelectedBase(size_t base);
58  void draw();
60  void mouseOver(Action *action, State *state);
61  void setColor(Uint8 color);
62  void setSecondaryColor(Uint8 color);
63 };
64 
65 }
Container for all the information associated with a given user action, like mouse clicks...
Definition: Action.h:32
A game state that receives user input and reacts accordingly.
Definition: State.h:44
Surface that the user can interact with.
Definition: InteractiveSurface.h:37
size_t getHoveredBase() const
Gets the base the mouse is over.
Definition: MiniBaseView.cpp:72
void setBases(std::vector< Base *> *bases)
Sets the base list to display.
Definition: MiniBaseView.cpp:52
void setSelectedBase(size_t base)
Sets the selected base for the mini base view.
Definition: MiniBaseView.cpp:82
void setTexture(SurfaceSet *texture)
Sets the texture for the mini base view.
Definition: MiniBaseView.cpp:63
void mouseOver(Action *action, State *state)
Special handling for mouse hovers.
Definition: MiniBaseView.cpp:156
Container of a set of surfaces.
Definition: SurfaceSet.h:35
void setSecondaryColor(Uint8 color)
Sets the secondary color of the surface.
Definition: MiniBaseView.cpp:166
void draw()
Draws the mini base view.
Definition: MiniBaseView.cpp:92
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:37
Mini view of a base.
Definition: MiniBaseView.h:34
~MiniBaseView()
Cleans up the mini base view.
Definition: MiniBaseView.cpp:44
void setColor(Uint8 color)
Sets the color of the surface.
Definition: MiniBaseView.cpp:162
Definition: BaseInfoState.cpp:40