/
GameController.h
168 lines (155 loc) · 4.99 KB
/
GameController.h
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#ifndef GAMECONTROLLER_H
#define GAMECONTROLLER_H
#include <queue>
#include "GameView.h"
#include "GameModel.h"
#include "simulation/Simulation.h"
#include "gui/interface/Point.h"
#include "gui/search/SearchController.h"
#include "gui/render/RenderController.h"
#include "gui/preview/PreviewController.h"
#include "gui/login/LoginController.h"
#include "gui/tags/TagsController.h"
#include "gui/console/ConsoleController.h"
#include "gui/localbrowser/LocalBrowserController.h"
#include "gui/options/OptionsController.h"
#include "client/ClientListener.h"
#include "RenderPreset.h"
#include "Menu.h"
using namespace std;
class DebugInfo;
class Notification;
class GameModel;
class GameView;
class CommandInterface;
class ConsoleController;
class GameController: public ClientListener
{
private:
//Simulation * sim;
bool firstTick;
int screenshotIndex;
sign * foundSign;
PreviewController * activePreview;
GameView * gameView;
GameModel * gameModel;
SearchController * search;
RenderController * renderOptions;
LoginController * loginWindow;
ConsoleController * console;
TagsController * tagsWindow;
LocalBrowserController * localBrowser;
OptionsController * options;
CommandInterface * commandInterface;
vector<DebugInfo*> debugInfo;
unsigned int debugFlags;
public:
bool HasDone;
class SearchCallback;
class SSaveCallback;
class TagsCallback;
class StampsCallback;
class OptionsCallback;
class SaveOpenCallback;
friend class SaveOpenCallback;
GameController();
~GameController();
GameView * GetView();
sign * GetSignAt(int x, int y);
bool BrushChanged(int brushType, int rx, int ry);
bool MouseMove(int x, int y, int dx, int dy);
bool MouseDown(int x, int y, unsigned button);
bool MouseUp(int x, int y, unsigned button);
bool MouseWheel(int x, int y, int d);
bool KeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt);
bool KeyRelease(int key, Uint16 character, bool shift, bool ctrl, bool alt);
bool MouseTick();
void Tick();
void Exit();
void Install();
void HistoryRestore();
void HistorySnapshot();
void AdjustGridSize(int direction);
void InvertAirSim();
void LoadRenderPreset(int presetNum);
void SetZoomEnabled(bool zoomEnable);
void SetZoomPosition(ui::Point position);
void AdjustBrushSize(int direction, bool logarithmic = false, bool xAxis = false, bool yAxis = false);
void SetBrushSize(ui::Point newSize);
void AdjustZoomSize(int direction, bool logarithmic = false);
void ToolClick(int toolSelection, ui::Point point);
void DrawPoints(int toolSelection, queue<ui::Point> & pointQueue);
void DrawRect(int toolSelection, ui::Point point1, ui::Point point2);
void DrawLine(int toolSelection, ui::Point point1, ui::Point point2);
void DrawFill(int toolSelection, ui::Point point);
std::string StampRegion(ui::Point point1, ui::Point point2);
void CopyRegion(ui::Point point1, ui::Point point2);
void CutRegion(ui::Point point1, ui::Point point2);
void Update();
void SetPaused(bool pauseState);
void SetPaused();
void SetDecoration(bool decorationState);
void SetDecoration();
void ShowGravityGrid();
void SetHudEnable(bool hudState);
bool GetHudEnable();
void SetDebugHUD(bool hudState);
bool GetDebugHUD();
void SetDebugFlags(unsigned int flags) { debugFlags = flags; }
void SetActiveMenu(int menuID);
std::vector<Menu*> GetMenuList();
Tool * GetActiveTool(int selection);
void SetActiveTool(int toolSelection, Tool * tool);
int GetReplaceModeFlags();
void SetReplaceModeFlags(int flags);
void ActiveToolChanged(int toolSelection, Tool *tool);
void SetActiveColourPreset(int preset);
void SetColour(ui::Colour colour);
void SetToolStrength(float value);
void LoadSaveFile(SaveFile * file);
void LoadSave(SaveInfo * save);
void OpenSearch();
void OpenLogin();
void OpenProfile();
void OpenTags();
void OpenSavePreview(int saveID, int saveDate, bool instant);
void OpenSavePreview();
void OpenLocalSaveWindow(bool asCurrent);
void OpenLocalBrowse();
void OpenOptions();
void OpenRenderOptions();
void OpenSaveWindow();
void SaveAsCurrent();
void OpenStamps();
void OpenElementSearch();
void OpenColourPicker();
void PlaceSave(ui::Point position);
void ClearSim();
void ReloadSim();
void Vote(int direction);
void ChangeBrush();
void ShowConsole();
void HideConsole();
void FrameStep();
void TranslateSave(ui::Point point);
void TransformSave(matrix2d transform);
ui::Point PointTranslate(ui::Point point);
ui::Point NormaliseBlockCoord(ui::Point point);
std::string ElementResolve(int type, int ctype);
bool IsValidElement(int type);
std::string WallName(int type);
void ResetAir();
void ResetSpark();
void SwitchGravity();
void SwitchAir();
void ToggleAHeat();
void ToggleNewtonianGravity();
void LoadClipboard();
void LoadStamp();
void RemoveNotification(Notification * notification);
virtual void NotifyUpdateAvailable(Client * sender);
virtual void NotifyAuthUserChanged(Client * sender);
virtual void NotifyNewNotification(Client * sender, std::pair<std::string, std::string> notification);
void RunUpdater();
};
#endif // GAMECONTROLLER_H