-
Notifications
You must be signed in to change notification settings - Fork 14
/
interfaces.d
133 lines (108 loc) · 3 KB
/
interfaces.d
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
// Copyright © 2012, Jakob Bornecrantz. All rights reserved.
// See copyright notice in src/charge/charge.d (GPLv2 only).
module miners.interfaces;
import charge.gfx.camera : GfxCamera = Camera;
import charge.gfx.world : GfxWorld = World;
import charge.gfx.target : GfxRenderTarget = RenderTarget;
static import charge.game.scene.scene;
import miners.types;
import miners.classic.interfaces : ClassicClientConnection;
alias charge.game.scene.scene.Scene Scene;
/**
* Specialized router for Miners.
*/
interface Router : charge.game.scene.scene.SceneManager
{
/*
*
* Scene related.
*
*/
/**
* Render the world, from camera to rt.
*/
void render(GfxWorld w, GfxCamera c, GfxRenderTarget rt);
/**
* Load a level, name should be a classic level filename.
*
* If name is null it generates a simple flatland.
*/
void loadLevelClassic(string name);
/**
* Start a classic scene listening to the given connection.
*/
void connectedTo(ClassicClientConnection cc,
uint x, uint y, uint z,
ubyte[] data);
/*
*
* Menu related functions
*
*/
/**
* Shows the main menu, overlays the current scene.
*/
void displayMainMenu();
/**
* See above.
*/
void displayPauseMenu();
/**
* See above, but specialized for classic.
*/
void displayClassicPauseMenu(Scene part);
/**
* Display a generic info menu.
* Dg is called on button pressed, if null the menu will be closed.
*
* Also see above.
*/
void displayInfo(string header, string[] texts,
string buttonText, void delegate() dg);
/**
* Display the classic block selector.
*/
void displayClassicBlockSelector(void delegate(ubyte) selectedDg);
/**
* Display the classic server list.
*/
void displayClassicMenu();
/**
* Display a list of classic servers that the user can connect to.
*/
void displayClassicList(ClassicServerInfo[] csi);
/**
* Connect to a classic server by first connecting to the
* minecraft.net server looking up mppass and other details
* with the serverId given in ClassicServerInfo.
*/
void getClassicServerInfoAndConnect(ClassicServerInfo csi);
/**
* Connect to a classic server using the server address,
* port, mppass & username in the given ClassicServerInfo.
*/
void connectToClassic(ClassicServerInfo csi);
/**
* Connect to a classic server by first connecting to the
* minecraft.net server looking up mppass and other details
* with the serverId given in ClassicServerInfo.
*
* This function is unsecure and should only be used for debugging.
*/
void connectToClassic(string user, string pass, ClassicServerInfo csi);
/**
* Display the a world change menu.
*/
void classicWorldChange(ClassicClientConnection cc);
/**
* Displays a error message menu, if panic is true the
* only the only thing to do is close the game.
*
* Closes any other menu and overlays the current scene.
*/
void displayError(Exception e, bool panic);
/**
* See above.
*/
void displayError(string[] texts, bool panic);
}