OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MiniMapView.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_MINIMAPVIEW_H
20 #define OPENXCOM_MINIMAPVIEW_H
21 
22 #include "../Engine/InteractiveSurface.h"
23 #include "Position.h"
24 
25 namespace OpenXcom
26 {
27 
28 class Game;
29 class Camera;
30 class SavedBattleGame;
31 class SurfaceSet;
32 
37 {
38  Game * _game;
39  Camera * _camera;
40  SavedBattleGame * _battleGame;
41  int _frame;
42  SurfaceSet * _set;
43  // these two are required for right-button scrolling on the minimap
44  bool _isMouseScrolling;
45  bool _isMouseScrolled;
46  int _xBeforeMouseScrolling, _yBeforeMouseScrolling;
47  int _mouseScrollX, _mouseScrollY;
48  Position _posBeforeMouseScrolling, _cursorPosition;
49  Uint32 _mouseScrollingStartTime;
50  int _totalMouseMoveX, _totalMouseMoveY;
51  bool _mouseMovedOverThreshold;
53  void mousePress(Action *action, State *state);
55  void mouseClick(Action *action, State *state);
57  void mouseOver(Action *action, State *state);
59  void mouseIn(Action *action, State *state);
60 public:
62  MiniMapView(int w, int h, int x, int y, Game * game, Camera * camera, SavedBattleGame * battleGame);
64  void draw();
66  int up();
68  int down();
70  void animate();
71  void stopScrolling(Action *action);
72 };
73 
74 }
75 
76 #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
Class handling camera movement, either by mouse or by events on the battlescape.
Definition: Camera.h:35
void animate()
Updates the minimap animation.
Definition: MiniMapView.cpp:388
int down()
Changes the displayed minimap level.
Definition: MiniMapView.cpp:169
Container of a set of surfaces.
Definition: SurfaceSet.h:38
void draw()
Draws the minimap.
Definition: MiniMapView.cpp:62
int up()
Changes the displayed minimap level.
Definition: MiniMapView.cpp:158
MiniMapView is the class used to display the map in the MiniMapState.
Definition: MiniMapView.h:36
MiniMapView(int w, int h, int x, int y, Game *game, Camera *camera, SavedBattleGame *battleGame)
Creates the MiniMapView.
Definition: MiniMapView.cpp:54
The battlescape data that gets written to disk when the game is saved.
Definition: SavedBattleGame.h:50
The core of the game engine, manages the game's entire contents and structure.
Definition: Game.h:44
Easy handling of X-Y-Z coordinates.
Definition: Position.h:30