author | Medo <smaxein@googlemail.com> |
Mon, 06 Aug 2012 22:39:36 +0200 (2012-08-06) | |
changeset 7476 | 2fb781bbdd51 |
child 7485 | 0481bd74267c |
permissions | -rw-r--r-- |
7476
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
1 |
package org.hedgewars.hedgeroid.frontlib; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
2 |
import java.nio.Buffer; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
3 |
import java.util.ArrayList; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
4 |
import java.util.HashMap; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
5 |
import java.util.List; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
6 |
import java.util.Map; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
7 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
8 |
import org.hedgewars.hedgeroid.Datastructures.Hog; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
9 |
import org.hedgewars.hedgeroid.Datastructures.MetaScheme; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
10 |
import org.hedgewars.hedgeroid.Datastructures.MetaScheme.Mod; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
11 |
import org.hedgewars.hedgeroid.Datastructures.MetaScheme.Setting; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
12 |
import org.hedgewars.hedgeroid.Datastructures.RoomlistRoom; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
13 |
import org.hedgewars.hedgeroid.Datastructures.Scheme; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
14 |
import org.hedgewars.hedgeroid.Datastructures.Team; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
15 |
import org.hedgewars.hedgeroid.Datastructures.TeamInGame; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
16 |
import org.hedgewars.hedgeroid.Datastructures.TeamIngameAttributes; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
17 |
import org.hedgewars.hedgeroid.EngineProtocol.GameConfig; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
18 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
19 |
import com.sun.jna.Callback; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
20 |
import com.sun.jna.Library; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
21 |
import com.sun.jna.Memory; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
22 |
import com.sun.jna.NativeLong; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
23 |
import com.sun.jna.Pointer; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
24 |
import com.sun.jna.PointerType; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
25 |
import com.sun.jna.Structure; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
26 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
27 |
public interface Frontlib extends Library { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
28 |
static final int NATIVE_INT_SIZE = 4; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
29 |
static final int NATIVE_BOOL_SIZE = 1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
30 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
31 |
static final int NETCONN_STATE_CONNECTING = 0; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
32 |
static final int NETCONN_STATE_LOBBY = 1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
33 |
static final int NETCONN_STATE_ROOM = 2; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
34 |
static final int NETCONN_STATE_INGAME = 3; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
35 |
static final int NETCONN_STATE_DISCONNECTED = 10; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
36 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
37 |
static final int NETCONN_DISCONNECT_NORMAL = 0; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
38 |
static final int NETCONN_DISCONNECT_SERVER_TOO_OLD = 1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
39 |
static final int NETCONN_DISCONNECT_AUTH_FAILED = 2; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
40 |
static final int NETCONN_DISCONNECT_CONNLOST = 3; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
41 |
static final int NETCONN_DISCONNECT_INTERNAL_ERROR = 100; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
42 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
43 |
static final int NETCONN_ROOMLEAVE_ABANDONED = 0; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
44 |
static final int NETCONN_ROOMLEAVE_KICKED = 1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
45 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
46 |
static final int NETCONN_MSG_TYPE_PLAYERINFO = 0; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
47 |
static final int NETCONN_MSG_TYPE_SERVERMESSAGE = 1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
48 |
static final int NETCONN_MSG_TYPE_WARNING = 2; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
49 |
static final int NETCONN_MSG_TYPE_ERROR = 3; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
50 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
51 |
static final int NETCONN_MAPCHANGE_FULL = 0; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
52 |
static final int NETCONN_MAPCHANGE_MAP = 1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
53 |
static final int NETCONN_MAPCHANGE_MAPGEN = 2; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
54 |
static final int NETCONN_MAPCHANGE_DRAWNMAP = 3; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
55 |
static final int NETCONN_MAPCHANGE_MAZE_SIZE = 4; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
56 |
static final int NETCONN_MAPCHANGE_TEMPLATE = 5; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
57 |
static final int NETCONN_MAPCHANGE_THEME = 6; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
58 |
static final int NETCONN_MAPCHANGE_SEED = 7; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
59 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
60 |
static final int GAME_END_FINISHED = 0; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
61 |
static final int GAME_END_INTERRUPTED = 1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
62 |
static final int GAME_END_HALTED = 2; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
63 |
static final int GAME_END_ERROR = 3; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
64 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
65 |
static final int HEDGEHOGS_PER_TEAM = 8; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
66 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
67 |
public static class NetconnPtr extends PointerType { } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
68 |
public static class MapconnPtr extends PointerType { } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
69 |
public static class GameconnPtr extends PointerType { } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
70 |
public static class MetaschemePtr extends PointerType { } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
71 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
72 |
public static class RoomArrayPtr extends PointerType { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
73 |
/** |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
74 |
* Returns the (native-owned) rooms in this list |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
75 |
*/ |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
76 |
public RoomlistRoom[] getRooms(int count) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
77 |
Pointer ptr = getPointer(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
78 |
if(ptr == null) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
79 |
return new RoomlistRoom[0]; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
80 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
81 |
Pointer[] untypedPtrs = ptr.getPointerArray(0, count); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
82 |
RoomlistRoom[] result = new RoomlistRoom[count]; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
83 |
for(int i=0; i<count; i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
84 |
result[i] = RoomPtr.deref(untypedPtrs[i]); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
85 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
86 |
return result; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
87 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
88 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
89 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
90 |
public static class RoomPtr extends PointerType { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
91 |
public RoomPtr() { super(); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
92 |
public RoomPtr(Pointer ptr) { super(ptr); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
93 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
94 |
public RoomlistRoom deref() { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
95 |
return deref(getPointer()); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
96 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
97 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
98 |
public static RoomlistRoom deref(Pointer p) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
99 |
RoomStruct r = new RoomStruct(p); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
100 |
r.read(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
101 |
return new RoomlistRoom(r.name, r.map, r.scheme, r.weapons, r.owner, r.playerCount, r.teamCount, r.inProgress); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
102 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
103 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
104 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
105 |
public static class TeamPtr extends PointerType { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
106 |
public TeamInGame deref() { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
107 |
return deref(getPointer()); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
108 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
109 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
110 |
public static TeamInGame deref(Pointer p) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
111 |
TeamStruct ts = new TeamStruct(p); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
112 |
ts.read(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
113 |
List<Hog> hogs = new ArrayList<Hog>(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
114 |
for(int i=0; i<ts.hogs.length; i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
115 |
HogStruct hog = ts.hogs[i]; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
116 |
hogs.add(new Hog(hog.name, hog.hat, hog.difficulty)); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
117 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
118 |
Team team = new Team(ts.name, ts.grave, ts.flag, ts.voicepack, ts.fort, hogs); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
119 |
TeamIngameAttributes attrs = new TeamIngameAttributes(ts.ownerName, ts.colorIndex, ts.hogsInGame, ts.remoteDriven); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
120 |
return new TeamInGame(team, attrs); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
121 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
122 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
123 |
public static TeamPtr createJavaOwned(Team t) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
124 |
return createJavaOwned(new TeamInGame(t, null)); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
125 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
126 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
127 |
public static TeamPtr createJavaOwned(TeamInGame ingameTeam) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
128 |
TeamStruct ts = TeamStruct.from(ingameTeam.team, ingameTeam.ingameAttribs); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
129 |
ts.write(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
130 |
TeamPtr result = new TeamPtr(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
131 |
result.setPointer(ts.getPointer()); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
132 |
return result; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
133 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
134 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
135 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
136 |
public static class WeaponsetPtr extends PointerType { } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
137 |
public static class MapRecipePtr extends PointerType { } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
138 |
public static class SchemePtr extends PointerType { } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
139 |
public static class SchemelistPtr extends PointerType { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
140 |
private SchemelistStruct javaOwnedInstance; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
141 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
142 |
public List<Scheme> deref() { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
143 |
return deref(getPointer()); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
144 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
145 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
146 |
public static List<Scheme> deref(Pointer p) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
147 |
SchemelistStruct sls = new SchemelistStruct(p); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
148 |
sls.read(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
149 |
return sls.toSchemeList(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
150 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
151 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
152 |
public static SchemelistPtr createJavaOwned(List<Scheme> schemes) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
153 |
SchemelistPtr result = new SchemelistPtr(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
154 |
result.javaOwnedInstance = new SchemelistStruct(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
155 |
result.javaOwnedInstance.fillFrom(schemes); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
156 |
result.javaOwnedInstance.autoWrite(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
157 |
result.setPointer(result.javaOwnedInstance.getPointer()); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
158 |
return result; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
159 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
160 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
161 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
162 |
public static class GameSetupPtr extends PointerType { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
163 |
public static GameSetupPtr createJavaOwned(GameConfig conf) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
164 |
GameSetupStruct gss = GameSetupStruct.from(conf); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
165 |
gss.write(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
166 |
GameSetupPtr result = new GameSetupPtr(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
167 |
result.setPointer(gss.getPointer()); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
168 |
return result; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
169 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
170 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
171 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
172 |
static class HogStruct extends Structure { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
173 |
public static class ByVal extends HogStruct implements Structure.ByValue {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
174 |
public static class ByRef extends HogStruct implements Structure.ByReference {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
175 |
private static String[] FIELD_ORDER = new String[] {"name", "hat", "rounds", "kills", "deaths", "suicides", "difficulty", "initialHealth", "weaponset"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
176 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
177 |
public HogStruct() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
178 |
public HogStruct(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
179 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
180 |
public static HogStruct from(Hog hog) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
181 |
HogStruct hs = new HogStruct(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
182 |
hs.difficulty = hog.level; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
183 |
hs.hat = hog.hat; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
184 |
hs.name = hog.name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
185 |
// TODO weaponset |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
186 |
// TODO initialHealth |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
187 |
return hs; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
188 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
189 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
190 |
public String name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
191 |
public String hat; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
192 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
193 |
public int rounds; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
194 |
public int kills; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
195 |
public int deaths; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
196 |
public int suicides; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
197 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
198 |
public int difficulty; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
199 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
200 |
public int initialHealth; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
201 |
public WeaponsetPtr weaponset; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
202 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
203 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
204 |
static class TeamStruct extends Structure { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
205 |
public static class ByVal extends TeamStruct implements Structure.ByValue {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
206 |
public static class ByRef extends TeamStruct implements Structure.ByReference {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
207 |
private static String[] FIELD_ORDER = new String[] {"hogs", "name", "grave", "fort", "voicepack", "flag", "bindings", "bindingCount", "rounds", "wins", "campaignProgress", "colorIndex", "hogsInGame", "remoteDriven", "ownerName"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
208 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
209 |
public TeamStruct() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
210 |
public TeamStruct(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
211 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
212 |
public static TeamStruct from(Team team, TeamIngameAttributes attrs) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
213 |
TeamStruct ts = new TeamStruct(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
214 |
if(team != null) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
215 |
ts.name = team.name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
216 |
ts.grave = team.grave; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
217 |
ts.flag = team.flag; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
218 |
ts.voicepack = team.voice; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
219 |
ts.fort = team.fort; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
220 |
if(team.hogs.size() != HEDGEHOGS_PER_TEAM) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
221 |
throw new IllegalArgumentException(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
222 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
223 |
for(int i=0; i<ts.hogs.length; i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
224 |
ts.hogs[i] = HogStruct.from(team.hogs.get(i)); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
225 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
226 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
227 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
228 |
if(attrs != null) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
229 |
ts.hogsInGame = attrs.hogCount; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
230 |
ts.ownerName = attrs.ownerName; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
231 |
ts.colorIndex = attrs.colorIndex; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
232 |
ts.remoteDriven = attrs.remoteDriven; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
233 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
234 |
return ts; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
235 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
236 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
237 |
public HogStruct[] hogs = new HogStruct[HEDGEHOGS_PER_TEAM]; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
238 |
public String name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
239 |
public String grave; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
240 |
public String fort; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
241 |
public String voicepack; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
242 |
public String flag; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
243 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
244 |
public Pointer bindings; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
245 |
public int bindingCount; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
246 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
247 |
public int rounds; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
248 |
public int wins; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
249 |
public int campaignProgress; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
250 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
251 |
public int colorIndex; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
252 |
public int hogsInGame; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
253 |
public boolean remoteDriven; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
254 |
public String ownerName; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
255 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
256 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
257 |
static class RoomStruct extends Structure { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
258 |
public static class ByVal extends RoomStruct implements Structure.ByValue {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
259 |
public static class ByRef extends RoomStruct implements Structure.ByReference {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
260 |
private static String[] FIELD_ORDER = new String[] {"inProgress", "name", "playerCount", "teamCount", "owner", "map", "scheme", "weapons"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
261 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
262 |
public RoomStruct() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
263 |
public RoomStruct(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
264 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
265 |
public boolean inProgress; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
266 |
public String name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
267 |
public int playerCount; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
268 |
public int teamCount; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
269 |
public String owner; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
270 |
public String map; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
271 |
public String scheme; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
272 |
public String weapons; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
273 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
274 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
275 |
static class MapRecipeStruct extends Structure { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
276 |
public static class ByVal extends MapRecipeStruct implements Structure.ByValue {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
277 |
public static class ByRef extends MapRecipeStruct implements Structure.ByReference {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
278 |
private static String[] FIELD_ORDER = new String[] {"_referenceCount", "mapgen", "name", "seed", "theme", "drawData", "drawDataSize", "templateFilter", "mazeSize"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
279 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
280 |
public MapRecipeStruct() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
281 |
public MapRecipeStruct(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
282 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
283 |
public int _referenceCount; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
284 |
public int mapgen; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
285 |
public String name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
286 |
public String seed; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
287 |
public String theme; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
288 |
public Pointer drawData; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
289 |
public int drawDataSize; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
290 |
public int templateFilter; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
291 |
public int mazeSize; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
292 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
293 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
294 |
static class MetaschemeSettingStruct extends Structure { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
295 |
public static class ByVal extends MetaschemeSettingStruct implements Structure.ByValue {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
296 |
public static class ByRef extends MetaschemeSettingStruct implements Structure.ByReference {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
297 |
private static String[] FIELD_ORDER = new String[] {"name", "engineCommand", "maxMeansInfinity", "times1000", "min", "max", "def"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
298 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
299 |
public MetaschemeSettingStruct() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
300 |
public MetaschemeSettingStruct(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
301 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
302 |
public void fillFrom(Setting setting) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
303 |
name = setting.name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
304 |
engineCommand = setting.engineCommand; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
305 |
maxMeansInfinity = setting.maxMeansInfinity; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
306 |
times1000 = setting.times1000; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
307 |
min = setting.min; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
308 |
max = setting.max; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
309 |
def = setting.def; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
310 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
311 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
312 |
public MetaScheme.Setting toMetaSchemeSetting() { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
313 |
return new MetaScheme.Setting(name, engineCommand, maxMeansInfinity, times1000, min, max, def); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
314 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
315 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
316 |
public String name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
317 |
public String engineCommand; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
318 |
public boolean maxMeansInfinity; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
319 |
public boolean times1000; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
320 |
public int min; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
321 |
public int max; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
322 |
public int def; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
323 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
324 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
325 |
static class MetaschemeModStruct extends Structure { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
326 |
public static class ByVal extends MetaschemeModStruct implements Structure.ByValue {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
327 |
public static class ByRef extends MetaschemeModStruct implements Structure.ByReference {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
328 |
private static String[] FIELD_ORDER = new String[] {"name", "bitmaskIndex"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
329 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
330 |
public MetaschemeModStruct() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
331 |
public MetaschemeModStruct(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
332 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
333 |
public void fillFrom(Mod mod) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
334 |
name = mod.name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
335 |
bitmaskIndex = mod.bitmaskIndex; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
336 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
337 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
338 |
public MetaScheme.Mod toMetaSchemeMod() { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
339 |
return new MetaScheme.Mod(name, bitmaskIndex); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
340 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
341 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
342 |
public String name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
343 |
public int bitmaskIndex; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
344 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
345 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
346 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
347 |
static class MetaschemeStruct extends Structure { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
348 |
public static class ByVal extends MetaschemeStruct implements Structure.ByValue {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
349 |
public static class ByRef extends MetaschemeStruct implements Structure.ByReference {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
350 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
351 |
private static String[] FIELD_ORDER = new String[] {"_referenceCount", "settingCount", "modCount", "settings", "mods"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
352 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
353 |
public MetaschemeStruct() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
354 |
public MetaschemeStruct(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
355 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
356 |
public void fillFrom(MetaScheme metascheme) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
357 |
settingCount = metascheme.settings.size(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
358 |
modCount = metascheme.mods.size(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
359 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
360 |
settings = new MetaschemeSettingStruct.ByRef(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
361 |
Structure[] settingStructs = settings.toArray(settingCount); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
362 |
mods = new MetaschemeModStruct.ByRef(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
363 |
Structure[] modStructs = mods.toArray(modCount); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
364 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
365 |
for(int i=0; i<settingCount; i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
366 |
MetaschemeSettingStruct mss = (MetaschemeSettingStruct)settingStructs[i]; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
367 |
mss.fillFrom(metascheme.settings.get(i)); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
368 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
369 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
370 |
for(int i=0; i<modCount; i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
371 |
MetaschemeModStruct mms = (MetaschemeModStruct)modStructs[i]; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
372 |
mms.fillFrom(metascheme.mods.get(i)); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
373 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
374 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
375 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
376 |
/** |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
377 |
* Only use on native-owned structs! |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
378 |
* Calling this method on a Java-owned struct could cause garbage collection of referenced |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
379 |
* structures. |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
380 |
*/ |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
381 |
public MetaScheme toMetaScheme() { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
382 |
List<MetaScheme.Setting> settingList = new ArrayList<MetaScheme.Setting>(settingCount); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
383 |
List<MetaScheme.Mod> modList = new ArrayList<MetaScheme.Mod>(modCount); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
384 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
385 |
Structure[] settingStructs = settings.toArray(settingCount); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
386 |
Structure[] modStructs = mods.toArray(modCount); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
387 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
388 |
for(int i=0; i<settingCount; i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
389 |
MetaschemeSettingStruct mss = (MetaschemeSettingStruct)settingStructs[i]; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
390 |
settingList.add(mss.toMetaSchemeSetting()); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
391 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
392 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
393 |
for(int i=0; i<modCount; i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
394 |
MetaschemeModStruct mms = (MetaschemeModStruct)modStructs[i]; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
395 |
modList.add(mms.toMetaSchemeMod()); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
396 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
397 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
398 |
return new MetaScheme(modList, settingList); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
399 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
400 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
401 |
public int _referenceCount; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
402 |
public int settingCount; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
403 |
public int modCount; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
404 |
public MetaschemeSettingStruct.ByRef settings; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
405 |
public MetaschemeModStruct.ByRef mods; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
406 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
407 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
408 |
static class SchemeStruct extends Structure { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
409 |
public static class ByVal extends SchemeStruct implements Structure.ByValue {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
410 |
public static class ByRef extends SchemeStruct implements Structure.ByReference {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
411 |
private static String[] FIELD_ORDER = new String[] {"_referenceCount", "meta", "name", "settings", "mod"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
412 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
413 |
public SchemeStruct() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
414 |
public SchemeStruct(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
415 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
416 |
public void fillFrom(Scheme scheme) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
417 |
meta = new MetaschemeStruct.ByRef(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
418 |
meta.fillFrom(scheme.metascheme); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
419 |
name = scheme.name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
420 |
settings = new Memory(NATIVE_INT_SIZE * scheme.metascheme.settings.size()); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
421 |
for(int i=0; i<scheme.metascheme.settings.size(); i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
422 |
Integer value = scheme.settings.get(scheme.metascheme.settings.get(i).name); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
423 |
settings.setInt(NATIVE_INT_SIZE*i, value); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
424 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
425 |
mods = new Memory(NATIVE_BOOL_SIZE * scheme.metascheme.mods.size()); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
426 |
for(int i=0; i<scheme.metascheme.mods.size(); i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
427 |
Boolean value = scheme.mods.get(scheme.metascheme.mods.get(i).name); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
428 |
mods.setByte(NATIVE_BOOL_SIZE*i, (byte)(value ? 1 : 0)); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
429 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
430 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
431 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
432 |
public Scheme toScheme() { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
433 |
MetaScheme metaScheme = meta.toMetaScheme(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
434 |
Map<String, Integer> settingsMap = new HashMap<String, Integer>(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
435 |
for(int i=0; i<metaScheme.settings.size(); i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
436 |
settingsMap.put(metaScheme.settings.get(i).name, settings.getInt(NATIVE_INT_SIZE*i)); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
437 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
438 |
Map<String, Boolean> modsMap = new HashMap<String, Boolean>(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
439 |
for(int i=0; i<metaScheme.mods.size(); i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
440 |
modsMap.put(metaScheme.mods.get(i).name, mods.getByte(i) != 0 ? Boolean.TRUE : Boolean.FALSE); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
441 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
442 |
return new Scheme(metaScheme, name, settingsMap, modsMap); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
443 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
444 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
445 |
public int _referenceCount; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
446 |
public MetaschemeStruct.ByRef meta; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
447 |
public String name; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
448 |
public Pointer settings; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
449 |
public Pointer mods; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
450 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
451 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
452 |
/** |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
453 |
* Represents a flib_scheme*, for use as part of a flib_scheme** |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
454 |
*/ |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
455 |
static class SchemePointerByReference extends Structure implements Structure.ByReference { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
456 |
private static String[] FIELD_ORDER = new String[] {"scheme"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
457 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
458 |
public SchemePointerByReference() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
459 |
public SchemePointerByReference(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
460 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
461 |
public SchemeStruct.ByRef scheme; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
462 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
463 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
464 |
static class SchemelistStruct extends Structure { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
465 |
public static class ByVal extends SchemelistStruct implements Structure.ByValue {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
466 |
public static class ByRef extends SchemelistStruct implements Structure.ByReference {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
467 |
private static String[] FIELD_ORDER = new String[] {"schemeCount", "schemes"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
468 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
469 |
public SchemelistStruct() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
470 |
public SchemelistStruct(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
471 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
472 |
/** |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
473 |
* Only use on native-owned structs! |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
474 |
* Calling this method on a Java-owned struct could cause garbage collection of referenced |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
475 |
* structures. |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
476 |
*/ |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
477 |
public List<Scheme> toSchemeList() { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
478 |
if(schemeCount<=0) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
479 |
return new ArrayList<Scheme>(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
480 |
} else { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
481 |
List<Scheme> schemeList = new ArrayList<Scheme>(schemeCount); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
482 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
483 |
Structure[] schemePtrStructs = schemes.toArray(schemeCount); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
484 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
485 |
for(int i=0; i<schemeCount; i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
486 |
SchemePointerByReference spbr2 = (SchemePointerByReference)schemePtrStructs[i]; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
487 |
schemeList.add(spbr2.scheme.toScheme()); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
488 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
489 |
return schemeList; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
490 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
491 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
492 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
493 |
public void fillFrom(List<Scheme> schemeList) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
494 |
schemeCount = schemeList.size(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
495 |
schemes = new SchemePointerByReference(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
496 |
Structure[] schemePtrStructs = schemes.toArray(schemeCount); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
497 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
498 |
for(int i=0; i<this.schemeCount; i++) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
499 |
SchemePointerByReference spbr = (SchemePointerByReference)schemePtrStructs[i]; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
500 |
spbr.scheme = new SchemeStruct.ByRef(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
501 |
spbr.scheme.fillFrom(schemeList.get(i)); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
502 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
503 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
504 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
505 |
public int schemeCount; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
506 |
public SchemePointerByReference schemes; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
507 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
508 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
509 |
static class TeamlistStruct extends Structure { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
510 |
public static class ByVal extends TeamlistStruct implements Structure.ByValue {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
511 |
public static class ByRef extends TeamlistStruct implements Structure.ByReference {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
512 |
private static String[] FIELD_ORDER = new String[] {"teamCount", "teams"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
513 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
514 |
public TeamlistStruct() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
515 |
public TeamlistStruct(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
516 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
517 |
public int teamCount; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
518 |
public Pointer teams; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
519 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
520 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
521 |
static class GameSetupStruct extends Structure { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
522 |
public static class ByVal extends GameSetupStruct implements Structure.ByValue {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
523 |
public static class ByRef extends GameSetupStruct implements Structure.ByReference {} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
524 |
private static String[] FIELD_ORDER = new String[] {"script", "gamescheme", "map", "teamlist"}; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
525 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
526 |
public GameSetupStruct() { super(); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
527 |
public GameSetupStruct(Pointer ptr) { super(ptr); setFieldOrder(FIELD_ORDER); } |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
528 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
529 |
public static GameSetupStruct from(GameConfig conf) { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
530 |
GameSetupStruct gss = new GameSetupStruct(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
531 |
gss.gamescheme = new SchemeStruct.ByRef(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
532 |
gss.gamescheme.fillFrom(conf.scheme); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
533 |
gss.map = new MapRecipeStruct.ByRef(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
534 |
// TODO gss.map.fillFrom(conf.map, conf.seed, conf.theme); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
535 |
gss.script = conf.style; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
536 |
gss.teamlist = new TeamlistStruct.ByRef(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
537 |
// TODO gss.teamlist.fillFrom(conf.teams, conf.weapon); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
538 |
return gss; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
539 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
540 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
541 |
public String script; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
542 |
public SchemeStruct.ByRef gamescheme; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
543 |
public MapRecipeStruct.ByRef map; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
544 |
public TeamlistStruct.ByRef teamlist; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
545 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
546 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
547 |
public static interface VoidCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
548 |
void callback(Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
549 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
550 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
551 |
public static interface StrCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
552 |
void callback(Pointer context, String arg1); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
553 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
554 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
555 |
public static interface IntCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
556 |
void callback(Pointer context, int arg1); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
557 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
558 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
559 |
public static interface IntStrCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
560 |
void callback(Pointer context, int arg1, String arg2); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
561 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
562 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
563 |
public static interface StrIntCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
564 |
void callback(Pointer context, String arg1, int arg2); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
565 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
566 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
567 |
public static interface StrStrCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
568 |
void callback(Pointer context, String arg1, String arg2); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
569 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
570 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
571 |
public static interface RoomCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
572 |
void callback(Pointer context, RoomPtr arg1); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
573 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
574 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
575 |
public static interface RoomListCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
576 |
void callback(Pointer context, RoomArrayPtr arg1, int count); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
577 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
578 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
579 |
public static interface StrRoomCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
580 |
void callback(Pointer context, String arg1, RoomPtr arg2); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
581 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
582 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
583 |
public static interface BoolCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
584 |
void callback(Pointer context, boolean arg1); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
585 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
586 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
587 |
public static interface StrBoolCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
588 |
void callback(Pointer context, String arg1, boolean arg2); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
589 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
590 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
591 |
public static interface TeamCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
592 |
void callback(Pointer context, TeamPtr arg1); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
593 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
594 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
595 |
public static interface BytesCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
596 |
void callback(Pointer context, Pointer buffer, NativeLong size); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
597 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
598 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
599 |
public static interface BytesBoolCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
600 |
void callback(Pointer context, Pointer buffer, NativeLong size, boolean arg3); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
601 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
602 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
603 |
public static interface SchemeCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
604 |
void callback(Pointer context, SchemePtr arg1); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
605 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
606 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
607 |
public static interface MapIntCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
608 |
void callback(Pointer context, MapRecipePtr arg1, int arg2); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
609 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
610 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
611 |
public static interface WeaponsetCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
612 |
void callback(Pointer context, WeaponsetPtr arg1); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
613 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
614 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
615 |
public static interface MapimageCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
616 |
void callback(Pointer context, Pointer buffer, int hedgehogCount); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
617 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
618 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
619 |
public static interface LogCallback extends Callback { |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
620 |
void callback(int level, String logMessage); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
621 |
} |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
622 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
623 |
int flib_init(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
624 |
void flib_quit(); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
625 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
626 |
NetconnPtr flib_netconn_create(String playerName, MetaschemePtr meta, String dataDirPath, String host, int port); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
627 |
void flib_netconn_destroy(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
628 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
629 |
void flib_netconn_tick(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
630 |
boolean flib_netconn_is_chief(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
631 |
boolean flib_netconn_is_in_room_context(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
632 |
String flib_netconn_get_playername(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
633 |
GameSetupPtr flib_netconn_create_gamesetup(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
634 |
int flib_netconn_send_quit(NetconnPtr conn, String quitmsg); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
635 |
int flib_netconn_send_chat(NetconnPtr conn, String chat); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
636 |
int flib_netconn_send_teamchat(NetconnPtr conn, String msg); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
637 |
int flib_netconn_send_password(NetconnPtr conn, String passwd); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
638 |
int flib_netconn_send_nick(NetconnPtr conn, String nick); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
639 |
int flib_netconn_send_request_roomlist(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
640 |
int flib_netconn_send_joinRoom(NetconnPtr conn, String room); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
641 |
int flib_netconn_send_createRoom(NetconnPtr conn, String room); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
642 |
int flib_netconn_send_renameRoom(NetconnPtr conn, String roomName); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
643 |
int flib_netconn_send_leaveRoom(NetconnPtr conn, String msg); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
644 |
int flib_netconn_send_toggleReady(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
645 |
int flib_netconn_send_addTeam(NetconnPtr conn, TeamPtr team); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
646 |
int flib_netconn_send_removeTeam(NetconnPtr conn, String teamname); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
647 |
int flib_netconn_send_engineMessage(NetconnPtr conn, Buffer message, NativeLong size); // TODO check if NativeLong==size_t |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
648 |
int flib_netconn_send_teamHogCount(NetconnPtr conn, String teamname, int hogcount); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
649 |
int flib_netconn_send_teamColor(NetconnPtr conn, String teamname, int colorIndex); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
650 |
int flib_netconn_send_weaponset(NetconnPtr conn, WeaponsetPtr weaponset); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
651 |
int flib_netconn_send_map(NetconnPtr conn, MapRecipePtr map); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
652 |
int flib_netconn_send_mapName(NetconnPtr conn, String mapName); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
653 |
int flib_netconn_send_mapGen(NetconnPtr conn, int mapGen); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
654 |
int flib_netconn_send_mapTemplate(NetconnPtr conn, int templateFilter); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
655 |
int flib_netconn_send_mapMazeSize(NetconnPtr conn, int mazeSize); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
656 |
int flib_netconn_send_mapSeed(NetconnPtr conn, String seed); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
657 |
int flib_netconn_send_mapTheme(NetconnPtr conn, String theme); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
658 |
int flib_netconn_send_mapDrawdata(NetconnPtr conn, Buffer drawData, NativeLong size); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
659 |
int flib_netconn_send_script(NetconnPtr conn, String scriptName); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
660 |
int flib_netconn_send_scheme(NetconnPtr conn, SchemePtr scheme); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
661 |
int flib_netconn_send_roundfinished(NetconnPtr conn, boolean withoutError); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
662 |
int flib_netconn_send_ban(NetconnPtr conn, String playerName); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
663 |
int flib_netconn_send_kick(NetconnPtr conn, String playerName); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
664 |
int flib_netconn_send_playerInfo(NetconnPtr conn, String playerName); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
665 |
int flib_netconn_send_playerFollow(NetconnPtr conn, String playerName); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
666 |
int flib_netconn_send_startGame(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
667 |
int flib_netconn_send_toggleRestrictJoins(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
668 |
int flib_netconn_send_toggleRestrictTeams(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
669 |
int flib_netconn_send_clearAccountsCache(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
670 |
int flib_netconn_send_setServerVar(NetconnPtr conn, String name, String value); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
671 |
int flib_netconn_send_getServerVars(NetconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
672 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
673 |
void flib_netconn_onMessage(NetconnPtr conn, IntStrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
674 |
void flib_netconn_onChat(NetconnPtr conn, StrStrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
675 |
void flib_netconn_onConnected(NetconnPtr conn, VoidCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
676 |
void flib_netconn_onDisconnected(NetconnPtr conn, IntStrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
677 |
void flib_netconn_onRoomlist(NetconnPtr conn, RoomListCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
678 |
void flib_netconn_onRoomAdd(NetconnPtr conn, RoomCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
679 |
void flib_netconn_onRoomDelete(NetconnPtr conn, StrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
680 |
void flib_netconn_onRoomUpdate(NetconnPtr conn, StrRoomCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
681 |
void flib_netconn_onLobbyJoin(NetconnPtr conn, StrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
682 |
void flib_netconn_onLobbyLeave(NetconnPtr conn, StrStrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
683 |
void flib_netconn_onNickTaken(NetconnPtr conn, StrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
684 |
void flib_netconn_onPasswordRequest(NetconnPtr conn, StrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
685 |
void flib_netconn_onEnterRoom(NetconnPtr conn, BoolCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
686 |
void flib_netconn_onRoomChiefStatus(NetconnPtr conn, BoolCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
687 |
void flib_netconn_onReadyState(NetconnPtr conn, StrBoolCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
688 |
void flib_netconn_onLeaveRoom(NetconnPtr conn, IntStrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
689 |
void flib_netconn_onTeamAdd(NetconnPtr conn, TeamCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
690 |
void flib_netconn_onTeamDelete(NetconnPtr conn, StrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
691 |
void flib_netconn_onRoomJoin(NetconnPtr conn, StrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
692 |
void flib_netconn_onRoomLeave(NetconnPtr conn, StrStrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
693 |
void flib_netconn_onRunGame(NetconnPtr conn, VoidCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
694 |
void flib_netconn_onTeamAccepted(NetconnPtr conn, StrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
695 |
void flib_netconn_onHogCountChanged(NetconnPtr conn, StrIntCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
696 |
void flib_netconn_onTeamColorChanged(NetconnPtr conn, StrIntCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
697 |
void flib_netconn_onEngineMessage(NetconnPtr conn, BytesCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
698 |
void flib_netconn_onCfgScheme(NetconnPtr conn, SchemeCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
699 |
void flib_netconn_onMapChanged(NetconnPtr conn, MapIntCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
700 |
void flib_netconn_onScriptChanged(NetconnPtr conn, StrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
701 |
void flib_netconn_onWeaponsetChanged(NetconnPtr conn, WeaponsetCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
702 |
void flib_netconn_onAdminAccess(NetconnPtr conn, VoidCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
703 |
void flib_netconn_onServerVar(NetconnPtr conn, StrStrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
704 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
705 |
// Gameconn |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
706 |
GameconnPtr flib_gameconn_create(String playerName, GameSetupPtr setup, boolean netgame); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
707 |
GameconnPtr flib_gameconn_create_playdemo(Buffer demo, NativeLong size); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
708 |
GameconnPtr flib_gameconn_create_loadgame(String playerName, Buffer save, NativeLong size); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
709 |
GameconnPtr flib_gameconn_create_campaign(String playerName, String seed, String script); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
710 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
711 |
void flib_gameconn_destroy(GameconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
712 |
int flib_gameconn_getport(GameconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
713 |
void flib_gameconn_tick(GameconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
714 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
715 |
int flib_gameconn_send_enginemsg(GameconnPtr conn, Buffer data, NativeLong len); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
716 |
int flib_gameconn_send_textmsg(GameconnPtr conn, int msgtype, String msg); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
717 |
int flib_gameconn_send_chatmsg(GameconnPtr conn, String playername, String msg); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
718 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
719 |
void flib_gameconn_onConnect(GameconnPtr conn, VoidCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
720 |
void flib_gameconn_onDisconnect(GameconnPtr conn, IntCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
721 |
void flib_gameconn_onErrorMessage(GameconnPtr conn, StrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
722 |
void flib_gameconn_onChat(GameconnPtr conn, StrBoolCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
723 |
void flib_gameconn_onGameRecorded(GameconnPtr conn, BytesBoolCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
724 |
void flib_gameconn_onEngineMessage(GameconnPtr conn, BytesCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
725 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
726 |
// MapConn |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
727 |
MapconnPtr flib_mapconn_create(MapRecipePtr mapdesc); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
728 |
void flib_mapconn_destroy(MapconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
729 |
int flib_mapconn_getport(MapconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
730 |
void flib_mapconn_onSuccess(MapconnPtr conn, MapimageCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
731 |
void flib_mapconn_onFailure(MapconnPtr conn, StrCallback callback, Pointer context); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
732 |
void flib_mapconn_tick(MapconnPtr conn); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
733 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
734 |
// GameSetup |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
735 |
void flib_gamesetup_destroy(GameSetupPtr gamesetup); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
736 |
GameSetupPtr flib_gamesetup_copy(GameSetupPtr gamesetup); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
737 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
738 |
// MapRecipe |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
739 |
public static final int MAPGEN_REGULAR = 0; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
740 |
public static final int MAPGEN_MAZE = 1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
741 |
public static final int MAPGEN_DRAWN = 2; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
742 |
public static final int MAPGEN_NAMED = 3; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
743 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
744 |
public static final int TEMPLATEFILTER_ALL = 0; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
745 |
public static final int TEMPLATEFILTER_SMALL = 1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
746 |
public static final int TEMPLATEFILTER_MEDIUM = 2; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
747 |
public static final int TEMPLATEFILTER_LARGE = 3; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
748 |
public static final int TEMPLATEFILTER_CAVERN = 4; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
749 |
public static final int TEMPLATEFILTER_WACKY = 5; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
750 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
751 |
public static final int MAZE_SIZE_SMALL_TUNNELS = 0; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
752 |
public static final int MAZE_SIZE_MEDIUM_TUNNELS = 1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
753 |
public static final int MAZE_SIZE_LARGE_TUNNELS = 2; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
754 |
public static final int MAZE_SIZE_SMALL_ISLANDS = 3; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
755 |
public static final int MAZE_SIZE_MEDIUM_ISLANDS = 4; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
756 |
public static final int MAZE_SIZE_LARGE_ISLANDS = 5; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
757 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
758 |
MapRecipePtr flib_map_create_regular(String seed, String theme, int templateFilter); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
759 |
MapRecipePtr flib_map_create_maze(String seed, String theme, int mazeSize); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
760 |
MapRecipePtr flib_map_create_named(String seed, String name); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
761 |
MapRecipePtr flib_map_create_drawn(String seed, String theme, Buffer drawData, NativeLong drawDataSize); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
762 |
MapRecipePtr flib_map_copy(MapRecipePtr map); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
763 |
MapRecipePtr flib_map_retain(MapRecipePtr map); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
764 |
void flib_map_release(MapRecipePtr map); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
765 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
766 |
// Metascheme |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
767 |
MetaschemePtr flib_metascheme_from_ini(String filename); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
768 |
MetaschemePtr flib_metascheme_retain(MetaschemePtr metainfo); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
769 |
void flib_metascheme_release(MetaschemePtr metainfo); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
770 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
771 |
// Scheme lists |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
772 |
SchemelistPtr flib_schemelist_from_ini(MetaschemePtr meta, String filename); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
773 |
int flib_schemelist_to_ini(String filename, SchemelistPtr list); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
774 |
void flib_schemelist_destroy(SchemelistPtr list); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
775 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
776 |
// Team |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
777 |
void flib_team_destroy(TeamPtr team); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
778 |
TeamPtr flib_team_from_ini(String filename); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
779 |
int flib_team_to_ini(String filename, TeamPtr team); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
780 |
void flib_team_set_weaponset(TeamPtr team, WeaponsetPtr set); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
781 |
void flib_team_set_health(TeamPtr team, int health); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
782 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
783 |
// Logging |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
784 |
public static final int FLIB_LOGLEVEL_ALL = -100; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
785 |
public static final int FLIB_LOGLEVEL_DEBUG = -1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
786 |
public static final int FLIB_LOGLEVEL_INFO = 0; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
787 |
public static final int FLIB_LOGLEVEL_WARNING = 1; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
788 |
public static final int FLIB_LOGLEVEL_ERROR = 2; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
789 |
public static final int FLIB_LOGLEVEL_NONE = 100; |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
790 |
|
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
791 |
void flib_log_setLevel(int level); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
792 |
void flib_log_setCallback(LogCallback callback); |
2fb781bbdd51
Hedgeroid: Start using the frontlib for more operations
Medo <smaxein@googlemail.com>
parents:
diff
changeset
|
793 |
} |