Repository navigation
Expand file tree
/
Copy pathAsyncClientData.java
More file actions
141 lines (128 loc) · 5.12 KB
/
Copy pathAsyncClientData.java
File metadata and controls
141 lines (128 loc) · 5.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
package bwapi;
/**
* Asynchronous client data that routes static information to the main/static shared buffer
* and dynamic information to the packed dynamic buffer.
* Automatically generated by DumpToClient.
*/
class AsyncClientData extends ClientData {
static final int STATICTILES_START = 3447004;
static final int STATICTILES_END = 4823260;
static final int REGION_START = 5085404;
static final int REGION_END = 10586480;
static final int STRINGSSHAPES_START = 10962632;
static final int STRINGSHAPES_END = 32242636;
static final int UNITFINDER_START = 32962644;
static final int DYNAMIC_SLICE1_SIZE = STATICTILES_START;
static final int DYNAMIC_SLICE2_SIZE = REGION_START - STATICTILES_END;
static final int DYNAMIC_SLICE3_SIZE = STRINGSSHAPES_START - REGION_END;
static final int DYNAMIC_SLICE4_SIZE = UNITFINDER_START - STRINGSHAPES_END;
static final int DEST_SLICE1_OFFSET = 0;
static final int DEST_SLICE2_OFFSET = DYNAMIC_SLICE1_SIZE;
static final int DEST_SLICE3_OFFSET = DEST_SLICE2_OFFSET + DYNAMIC_SLICE2_SIZE;
static final int DEST_SLICE4_OFFSET = DEST_SLICE3_OFFSET + DYNAMIC_SLICE3_SIZE;
static final int BUFFER_SIZE = DEST_SLICE4_OFFSET + DYNAMIC_SLICE4_SIZE;
static final int DELTA_RANGE2 = STATICTILES_END - STATICTILES_START;
static final int DELTA_RANGE3 = DELTA_RANGE2 + (REGION_END - REGION_START);
static final int DELTA_RANGE4 = DELTA_RANGE3 + (STRINGSHAPES_END - STRINGSSHAPES_START);
private WrappedBuffer staticBuffer;
AsyncClientData() {
super();
}
AsyncClientData(WrappedBuffer staticBuffer) {
super();
this.staticBuffer = staticBuffer;
}
void setStaticBuffer(WrappedBuffer staticBuffer) {
this.staticBuffer = staticBuffer;
}
@Override
WrappedBuffer getStaticBuffer() {
return staticBuffer != null ? staticBuffer : buffer;
}
@Override
GameData createGameData(int offset) {
return new AsyncGameData(offset);
}
class AsyncGameData extends GameData {
AsyncGameData(int myOffset) {
super(myOffset);
}
@Override
int getGroundHeight(int i, int j) {
int offset = myOffset + 3447004 + 4 * 1 * j + 4 * 256 * i;
return getStaticBuffer().getInt(offset);
}
@Override
void setGetGroundHeight(int i, int j, int value) {
getStaticBuffer().putInt(myOffset + 3447004 + 4 * 1 * j + 4 * 256 * i, value);
}
@Override
boolean isWalkable(int i, int j) {
int offset = myOffset + 3709148 + 1 * 1 * j + 1 * 1024 * i;
return getStaticBuffer().getByte(offset) != 0;
}
@Override
void setIsWalkable(int i, int j, boolean value) {
getStaticBuffer().putByte(myOffset + 3709148 + 1 * 1 * j + 1 * 1024 * i, (byte) (value ? 1 : 0));
}
@Override
boolean isBuildable(int i, int j) {
int offset = myOffset + 4757724 + 1 * 1 * j + 1 * 256 * i;
return getStaticBuffer().getByte(offset) != 0;
}
@Override
void setIsBuildable(int i, int j, boolean value) {
getStaticBuffer().putByte(myOffset + 4757724 + 1 * 1 * j + 1 * 256 * i, (byte) (value ? 1 : 0));
}
@Override
short getMapTileRegionId(int i, int j) {
int offset = myOffset + 5085404 + 2 * 1 * j + 2 * 256 * i;
return getStaticBuffer().getShort(offset);
}
@Override
void setMapTileRegionId(int i, int j, short value) {
getStaticBuffer().putShort(myOffset + 5085404 + 2 * 1 * j + 2 * 256 * i, value);
}
@Override
short getMapSplitTilesMiniTileMask(int i) {
int offset = myOffset + 5216476 + 2 * 1 * i;
return getStaticBuffer().getShort(offset);
}
@Override
void setMapSplitTilesMiniTileMask(int i, short value) {
getStaticBuffer().putShort(myOffset + 5216476 + 2 * 1 * i, value);
}
@Override
short getMapSplitTilesRegion1(int i) {
int offset = myOffset + 5226476 + 2 * 1 * i;
return getStaticBuffer().getShort(offset);
}
@Override
void setMapSplitTilesRegion1(int i, short value) {
getStaticBuffer().putShort(myOffset + 5226476 + 2 * 1 * i, value);
}
@Override
short getMapSplitTilesRegion2(int i) {
int offset = myOffset + 5236476 + 2 * 1 * i;
return getStaticBuffer().getShort(offset);
}
@Override
void setMapSplitTilesRegion2(int i, short value) {
getStaticBuffer().putShort(myOffset + 5236476 + 2 * 1 * i, value);
}
@Override
int getRegionCount() {
int offset = myOffset + 5246476;
return getStaticBuffer().getInt(offset);
}
@Override
void setRegionCount(int value) {
getStaticBuffer().putInt(myOffset + 5246476, value);
}
@Override
RegionData getRegions(int i) {
int offset = myOffset + 5246480 + 1068 * 1 * i;
return new RegionData(offset);
}
}
}