Repository navigation
Expand file tree
/
Copy pathMiniBaseView.h
More file actions
66 lines (59 loc) · 1.87 KB
/
Copy pathMiniBaseView.h
File metadata and controls
66 lines (59 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Copyright 2010 OpenXcom Developers.
*
* This file is part of OpenXcom.
*
* OpenXcom is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* OpenXcom is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPENXCOM_MINIBASEVIEW_H
#define OPENXCOM_MINIBASEVIEW_H
#include <vector>
#include "../Engine/InteractiveSurface.h"
namespace OpenXcom
{
class Base;
class SurfaceSet;
/**
* Mini view of a base.
* Takes all the bases and displays their layout
* and allows players to swap between them.
*/
class MiniBaseView : public InteractiveSurface
{
private:
static const unsigned int MAX_BASES = 8;
static const int MINI_SIZE = 14;
std::vector<Base*> *_bases;
SurfaceSet *_texture;
unsigned int _base, _hoverBase;
public:
/// Creates a new mini base view at the specified position and size.
MiniBaseView(int width, int height, int x = 0, int y = 0);
/// Cleans up the mini base view.
~MiniBaseView();
/// Sets the base list to display.
void setBases(std::vector<Base*> *bases);
/// Sets the texture for the mini base view.
void setTexture(SurfaceSet *texture);
/// Gets the base the mouse is over.
unsigned int getHoveredBase() const;
/// Sets the selected base for the mini base view.
void setSelectedBase(unsigned int base);
/// Draws the mini base view.
void draw();
/// Special handling for mouse hovers.
void mouseOver(Action *action, State *state);
};
}
#endif