-
Notifications
You must be signed in to change notification settings - Fork 1
/
TestMonkeyThreading.java
54 lines (40 loc) · 1.48 KB
/
TestMonkeyThreading.java
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
package test.monkeythreads;
import com.jme3.app.SimpleApplication;
import com.jme3.system.AppSettings;
import core.threads.impl.monkeythreads.util.MonkeyBinder;
import javax.swing.*;
public class TestMonkeyThreading extends SimpleApplication {
private MonkeyBinder assetLoaderBinder;
private MonkeyBinder heavyDutyBinder;
static {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
TestMonkeyThreading app = new TestMonkeyThreading();
AppSettings settings = new AppSettings(true);
settings.setTitle("My Awesome Game");
app.setSettings(settings);
app.start();
}
@Override
public void simpleInitApp() {
heavyDutyBinder = MonkeyBinder.createMonkeyIPC(stateManager, "Heavy Duty Stuff");
heavyDutyBinder.addDaemonWork(new TestMonkeyDaemonBinder());
assetLoaderBinder = MonkeyBinder.createMonkeyIPC(stateManager, "Load Assets");
assetLoaderBinder.addDaemonWork(new TestMonkeyAssetLoader(this));
}
@Override
public void simpleUpdate(float tpf) {
//TODO: add update code
}
@Override
public void destroy() {
super.destroy();
heavyDutyBinder.terminate();
assetLoaderBinder.terminate();
}
}