wc3maptranslator 4.0.1 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/AngleConverter.d.ts +3 -0
- package/dist/src/AngleConverter.d.ts.map +1 -0
- package/dist/src/AngleConverter.js +12 -0
- package/dist/src/AngleConverter.js.map +1 -0
- package/dist/src/CommonInterfaces.d.ts +17 -0
- package/dist/src/CommonInterfaces.d.ts.map +1 -0
- package/dist/src/CommonInterfaces.js +3 -0
- package/dist/src/CommonInterfaces.js.map +1 -0
- package/dist/src/HexBuffer.d.ts +15 -0
- package/dist/src/HexBuffer.d.ts.map +1 -0
- package/{lib/HexBuffer.ts → dist/src/HexBuffer.js} +32 -42
- package/dist/src/HexBuffer.js.map +1 -0
- package/dist/src/W3Buffer.d.ts +14 -0
- package/dist/src/W3Buffer.d.ts.map +1 -0
- package/{lib/W3Buffer.ts → dist/src/W3Buffer.js} +25 -31
- package/dist/src/W3Buffer.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/{index.js → dist/src/index.js} +1 -1
- package/dist/src/index.js.map +1 -0
- package/dist/src/translators/CamerasTranslator.d.ts +23 -0
- package/dist/src/translators/CamerasTranslator.d.ts.map +1 -0
- package/{lib/translators/CamerasTranslator.ts → dist/src/translators/CamerasTranslator.js} +14 -39
- package/dist/src/translators/CamerasTranslator.js.map +1 -0
- package/dist/src/translators/DoodadsTranslator.d.ts +23 -0
- package/dist/src/translators/DoodadsTranslator.d.ts.map +1 -0
- package/{lib/translators/DoodadsTranslator.ts → dist/src/translators/DoodadsTranslator.js} +33 -65
- package/dist/src/translators/DoodadsTranslator.js.map +1 -0
- package/dist/src/translators/ImportsTranslator.d.ts +16 -0
- package/dist/src/translators/ImportsTranslator.d.ts.map +1 -0
- package/{lib/translators/ImportsTranslator.ts → dist/src/translators/ImportsTranslator.js} +21 -37
- package/dist/src/translators/ImportsTranslator.js.map +1 -0
- package/dist/src/translators/InfoTranslator.d.ts +124 -0
- package/dist/src/translators/InfoTranslator.d.ts.map +1 -0
- package/{lib/translators/InfoTranslator.ts → dist/src/translators/InfoTranslator.js} +108 -270
- package/dist/src/translators/InfoTranslator.js.map +1 -0
- package/dist/src/translators/ObjectsTranslator.d.ts +23 -0
- package/dist/src/translators/ObjectsTranslator.d.ts.map +1 -0
- package/{lib/translators/ObjectsTranslator.ts → dist/src/translators/ObjectsTranslator.js} +91 -125
- package/dist/src/translators/ObjectsTranslator.js.map +1 -0
- package/dist/src/translators/RegionsTranslator.d.ts +22 -0
- package/dist/src/translators/RegionsTranslator.d.ts.map +1 -0
- package/{lib/translators/RegionsTranslator.ts → dist/src/translators/RegionsTranslator.js} +18 -45
- package/dist/src/translators/RegionsTranslator.js.map +1 -0
- package/dist/src/translators/SoundsTranslator.d.ts +35 -0
- package/dist/src/translators/SoundsTranslator.d.ts.map +1 -0
- package/{lib/translators/SoundsTranslator.ts → dist/src/translators/SoundsTranslator.js} +30 -84
- package/dist/src/translators/SoundsTranslator.js.map +1 -0
- package/dist/src/translators/StringsTranslator.d.ts +7 -0
- package/dist/src/translators/StringsTranslator.d.ts.map +1 -0
- package/{lib/translators/StringsTranslator.ts → dist/src/translators/StringsTranslator.js} +12 -17
- package/dist/src/translators/StringsTranslator.js.map +1 -0
- package/dist/src/translators/TerrainTranslator.d.ts +33 -0
- package/dist/src/translators/TerrainTranslator.d.ts.map +1 -0
- package/{lib/translators/TerrainTranslator.ts → dist/src/translators/TerrainTranslator.js} +29 -84
- package/dist/src/translators/TerrainTranslator.js.map +1 -0
- package/dist/src/translators/UnitsTranslator.d.ts +40 -0
- package/dist/src/translators/UnitsTranslator.d.ts.map +1 -0
- package/{lib/translators/UnitsTranslator.ts → dist/src/translators/UnitsTranslator.js} +33 -95
- package/dist/src/translators/UnitsTranslator.js.map +1 -0
- package/{lib/translators/index.ts → dist/src/translators/index.d.ts} +1 -0
- package/dist/src/translators/index.d.ts.map +1 -0
- package/dist/src/translators/index.js +23 -0
- package/dist/src/translators/index.js.map +1 -0
- package/package.json +5 -4
- package/.codeclimate.yml +0 -12
- package/.editorconfig +0 -8
- package/.eslintignore +0 -5
- package/.eslintrc +0 -55
- package/.github/workflows/codeql-analysis.yml +0 -54
- package/.nycrc +0 -18
- package/.travis.yml +0 -23
- package/CHANGELOG.md +0 -78
- package/index.ts +0 -14
- package/lib/AngleConverter.ts +0 -7
- package/lib/CommonInterfaces.ts +0 -22
- package/test/.mocharc.json +0 -4
- package/test/AngleConverterTest.ts +0 -18
- package/test/HexBufferTest.ts +0 -170
- package/test/TranslatorReversion.ts +0 -218
- package/test/W3BufferTest.ts +0 -50
- package/test/data/cameras.json +0 -16
- package/test/data/doodads.json +0 -2730
- package/test/data/imports.json +0 -386
- package/test/data/info.json +0 -250
- package/test/data/obj-abilities.json +0 -4892
- package/test/data/obj-buffs.json +0 -38
- package/test/data/obj-destructables.json +0 -31
- package/test/data/obj-doodads.json +0 -38
- package/test/data/obj-items.json +0 -31
- package/test/data/obj-units.json +0 -40
- package/test/data/obj-upgrades.json +0 -38
- package/test/data/regions.json +0 -206
- package/test/data/sounds.json +0 -50
- package/test/data/strings.json +0 -115
- package/test/data/terrain.json +0 -1
- package/test/data/units.json +0 -452
- package/test/data/war3map.doo +0 -0
- package/test/data/war3map.imp +0 -0
- package/test/data/war3map.j +0 -3442
- package/test/data/war3map.shd +0 -0
- package/test/data/war3map.w3a +0 -0
- package/test/data/war3map.w3b +0 -0
- package/test/data/war3map.w3c +0 -0
- package/test/data/war3map.w3d +0 -0
- package/test/data/war3map.w3e +0 -0
- package/test/data/war3map.w3h +0 -0
- package/test/data/war3map.w3i +0 -0
- package/test/data/war3map.w3q +0 -0
- package/test/data/war3map.w3r +0 -0
- package/test/data/war3map.w3s +0 -0
- package/test/data/war3map.w3t +0 -0
- package/test/data/war3map.w3u +0 -0
- package/test/data/war3map.wts +0 -631
- package/test/data/war3mapUnits.doo +0 -0
- package/tsconfig.json +0 -25
- package/tslint.json +0 -47
|
@@ -1,56 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
eax: string;
|
|
10
|
-
flags: SoundFlags;
|
|
11
|
-
fadeRate: FadeRate;
|
|
12
|
-
volume: number;
|
|
13
|
-
pitch: number;
|
|
14
|
-
channel: number;
|
|
15
|
-
distance: Distance;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
interface FadeRate {
|
|
19
|
-
in: number;
|
|
20
|
-
out: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface SoundFlags {
|
|
24
|
-
looping: boolean; // 0x00000001=looping
|
|
25
|
-
'3dSound': boolean; // 0x00000002=3D sound
|
|
26
|
-
stopOutOfRange: boolean; // 0x00000004=stop when out of range
|
|
27
|
-
music: boolean; // 0x00000008=music
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
interface Distance {
|
|
31
|
-
min: number;
|
|
32
|
-
max: number;
|
|
33
|
-
cutoff: number;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export abstract class SoundsTranslator {
|
|
37
|
-
|
|
38
|
-
public static jsonToWar(soundsJson: Sound[]): WarResult {
|
|
39
|
-
const outBufferToWar = new HexBuffer();
|
|
40
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SoundsTranslator = void 0;
|
|
4
|
+
const HexBuffer_1 = require("../HexBuffer");
|
|
5
|
+
const W3Buffer_1 = require("../W3Buffer");
|
|
6
|
+
class SoundsTranslator {
|
|
7
|
+
static jsonToWar(soundsJson) {
|
|
8
|
+
const outBufferToWar = new HexBuffer_1.HexBuffer();
|
|
41
9
|
/*
|
|
42
10
|
* Header
|
|
43
11
|
*/
|
|
44
12
|
outBufferToWar.addInt(3); // file version
|
|
45
13
|
outBufferToWar.addInt(soundsJson.length); // number of sounds
|
|
46
|
-
|
|
47
14
|
/*
|
|
48
15
|
* Body
|
|
49
16
|
*/
|
|
50
17
|
soundsJson.forEach((sound) => {
|
|
51
18
|
outBufferToWar.addString(sound.name); // e.g. gg_snd_HumanGlueScreenLoop1
|
|
52
19
|
outBufferToWar.addString(sound.path); // e.g. Sound\Ambient\HumanGlueScreenLoop1.wav
|
|
53
|
-
|
|
54
20
|
// EAX effects enum (e.g. missiles, speech, etc)
|
|
55
21
|
/*
|
|
56
22
|
default = DefaultEAXON
|
|
@@ -62,31 +28,29 @@ export abstract class SoundsTranslator {
|
|
|
62
28
|
doodads = DoodadsEAX
|
|
63
29
|
*/
|
|
64
30
|
outBufferToWar.addString(sound.eax || 'DefaultEAXON'); // defaults to "DefaultEAXON"
|
|
65
|
-
|
|
66
31
|
// Flags, if present (optional)
|
|
67
32
|
let flags = 0;
|
|
68
33
|
if (sound.flags) {
|
|
69
|
-
if (sound.flags.looping)
|
|
70
|
-
|
|
71
|
-
if (sound.flags
|
|
72
|
-
|
|
34
|
+
if (sound.flags.looping)
|
|
35
|
+
flags |= 0x1;
|
|
36
|
+
if (sound.flags['3dSound'])
|
|
37
|
+
flags |= 0x2;
|
|
38
|
+
if (sound.flags.stopOutOfRange)
|
|
39
|
+
flags |= 0x4;
|
|
40
|
+
if (sound.flags.music)
|
|
41
|
+
flags |= 0x8;
|
|
73
42
|
}
|
|
74
43
|
outBufferToWar.addInt(flags);
|
|
75
|
-
|
|
76
44
|
// Fade in and out rate (optional)
|
|
77
45
|
outBufferToWar.addInt(sound.fadeRate ? sound.fadeRate.in || 10 : 10); // default to 10
|
|
78
46
|
outBufferToWar.addInt(sound.fadeRate ? sound.fadeRate.out || 10 : 10); // default to 10
|
|
79
|
-
|
|
80
47
|
// Volume (optional)
|
|
81
48
|
outBufferToWar.addInt(sound.volume || -1); // default to -1 (for normal volume)
|
|
82
|
-
|
|
83
49
|
// Pitch (optional)
|
|
84
50
|
outBufferToWar.addFloat(sound.pitch || 1.0); // default to 1.0 for normal pitch
|
|
85
|
-
|
|
86
51
|
// Mystery numbers... their use is unknown by the w3x documentation, but they must be present
|
|
87
52
|
outBufferToWar.addFloat(0);
|
|
88
53
|
outBufferToWar.addInt(8); // or -1?
|
|
89
|
-
|
|
90
54
|
// Which channel to use? Use the lookup table for more details (optional)
|
|
91
55
|
/*
|
|
92
56
|
0=General
|
|
@@ -106,12 +70,10 @@ export abstract class SoundsTranslator {
|
|
|
106
70
|
14=Fire
|
|
107
71
|
*/
|
|
108
72
|
outBufferToWar.addInt(sound.channel || 0); // default to 0
|
|
109
|
-
|
|
110
73
|
// Distance fields
|
|
111
74
|
outBufferToWar.addFloat(sound.distance.min);
|
|
112
75
|
outBufferToWar.addFloat(sound.distance.max);
|
|
113
76
|
outBufferToWar.addFloat(sound.distance.cutoff);
|
|
114
|
-
|
|
115
77
|
// More mystery numbers...
|
|
116
78
|
outBufferToWar.addFloat(0);
|
|
117
79
|
outBufferToWar.addFloat(0);
|
|
@@ -119,11 +81,9 @@ export abstract class SoundsTranslator {
|
|
|
119
81
|
outBufferToWar.addFloat(0);
|
|
120
82
|
outBufferToWar.addFloat(0);
|
|
121
83
|
outBufferToWar.addFloat(0);
|
|
122
|
-
|
|
123
84
|
outBufferToWar.addString(sound.variableName);
|
|
124
85
|
outBufferToWar.addString('');
|
|
125
86
|
outBufferToWar.addString(sound.path);
|
|
126
|
-
|
|
127
87
|
// More unknowns
|
|
128
88
|
outBufferToWar.addFloat(0);
|
|
129
89
|
outBufferToWar.addByte(0);
|
|
@@ -133,22 +93,18 @@ export abstract class SoundsTranslator {
|
|
|
133
93
|
outBufferToWar.addByte(0);
|
|
134
94
|
outBufferToWar.addFloat(0);
|
|
135
95
|
});
|
|
136
|
-
|
|
137
96
|
return {
|
|
138
97
|
errors: [],
|
|
139
98
|
buffer: outBufferToWar.getBuffer()
|
|
140
99
|
};
|
|
141
100
|
}
|
|
142
|
-
|
|
143
|
-
public static warToJson(buffer: Buffer): JsonResult<Sound[]> {
|
|
101
|
+
static warToJson(buffer) {
|
|
144
102
|
const result = [];
|
|
145
|
-
const outBufferToJSON = new W3Buffer(buffer);
|
|
146
|
-
|
|
103
|
+
const outBufferToJSON = new W3Buffer_1.W3Buffer(buffer);
|
|
147
104
|
const fileVersion = outBufferToJSON.readInt(), // File version
|
|
148
|
-
|
|
149
|
-
|
|
105
|
+
numSounds = outBufferToJSON.readInt(); // # of sounds
|
|
150
106
|
for (let i = 0; i < numSounds; i++) {
|
|
151
|
-
const sound
|
|
107
|
+
const sound = {
|
|
152
108
|
name: '',
|
|
153
109
|
variableName: '',
|
|
154
110
|
path: '',
|
|
@@ -157,10 +113,10 @@ export abstract class SoundsTranslator {
|
|
|
157
113
|
pitch: 0,
|
|
158
114
|
channel: 0,
|
|
159
115
|
flags: {
|
|
160
|
-
'looping': true,
|
|
161
|
-
'3dSound': true,
|
|
162
|
-
'stopOutOfRange': true,
|
|
163
|
-
'music': true
|
|
116
|
+
'looping': true,
|
|
117
|
+
'3dSound': true,
|
|
118
|
+
'stopOutOfRange': true,
|
|
119
|
+
'music': true // 0x00000008=music},
|
|
164
120
|
},
|
|
165
121
|
fadeRate: {
|
|
166
122
|
in: 0,
|
|
@@ -172,39 +128,31 @@ export abstract class SoundsTranslator {
|
|
|
172
128
|
cutoff: 0
|
|
173
129
|
}
|
|
174
130
|
};
|
|
175
|
-
|
|
176
131
|
sound.name = outBufferToJSON.readString();
|
|
177
132
|
sound.path = outBufferToJSON.readString();
|
|
178
133
|
sound.eax = outBufferToJSON.readString();
|
|
179
|
-
|
|
180
134
|
const flags = outBufferToJSON.readInt();
|
|
181
135
|
sound.flags = {
|
|
182
|
-
'looping': !!(flags & 0b1),
|
|
183
|
-
'3dSound': !!(flags & 0b10),
|
|
184
|
-
'stopOutOfRange': !!(flags & 0b100),
|
|
185
|
-
'music': !!(flags & 0b1000)
|
|
136
|
+
'looping': !!(flags & 0b1),
|
|
137
|
+
'3dSound': !!(flags & 0b10),
|
|
138
|
+
'stopOutOfRange': !!(flags & 0b100),
|
|
139
|
+
'music': !!(flags & 0b1000) // 0x00000008=music
|
|
186
140
|
};
|
|
187
|
-
|
|
188
141
|
sound.fadeRate = {
|
|
189
142
|
in: outBufferToJSON.readInt(),
|
|
190
143
|
out: outBufferToJSON.readInt()
|
|
191
144
|
};
|
|
192
|
-
|
|
193
145
|
sound.volume = outBufferToJSON.readInt();
|
|
194
146
|
sound.pitch = outBufferToJSON.readFloat();
|
|
195
|
-
|
|
196
147
|
// Unknown values
|
|
197
148
|
outBufferToJSON.readFloat();
|
|
198
149
|
outBufferToJSON.readInt();
|
|
199
|
-
|
|
200
150
|
sound.channel = outBufferToJSON.readInt();
|
|
201
|
-
|
|
202
151
|
sound.distance = {
|
|
203
152
|
min: outBufferToJSON.readFloat(),
|
|
204
153
|
max: outBufferToJSON.readFloat(),
|
|
205
154
|
cutoff: outBufferToJSON.readFloat()
|
|
206
155
|
};
|
|
207
|
-
|
|
208
156
|
// Unknown values
|
|
209
157
|
outBufferToJSON.readFloat();
|
|
210
158
|
outBufferToJSON.readFloat();
|
|
@@ -212,9 +160,7 @@ export abstract class SoundsTranslator {
|
|
|
212
160
|
outBufferToJSON.readFloat();
|
|
213
161
|
outBufferToJSON.readFloat();
|
|
214
162
|
outBufferToJSON.readFloat();
|
|
215
|
-
|
|
216
163
|
sound.variableName = outBufferToJSON.readString();
|
|
217
|
-
|
|
218
164
|
// Unknown values
|
|
219
165
|
outBufferToJSON.readString();
|
|
220
166
|
outBufferToJSON.readString();
|
|
@@ -225,13 +171,13 @@ export abstract class SoundsTranslator {
|
|
|
225
171
|
outBufferToJSON.readChars(4);
|
|
226
172
|
outBufferToJSON.readChars(1);
|
|
227
173
|
outBufferToJSON.readChars(4);
|
|
228
|
-
|
|
229
174
|
result.push(sound);
|
|
230
175
|
}
|
|
231
|
-
|
|
232
176
|
return {
|
|
233
177
|
errors: [],
|
|
234
178
|
json: result
|
|
235
179
|
};
|
|
236
180
|
}
|
|
237
181
|
}
|
|
182
|
+
exports.SoundsTranslator = SoundsTranslator;
|
|
183
|
+
//# sourceMappingURL=SoundsTranslator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SoundsTranslator.js","sourceRoot":"","sources":["../../../src/translators/SoundsTranslator.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,0CAAuC;AAkCvC,MAAsB,gBAAgB;IAE3B,MAAM,CAAC,SAAS,CAAC,UAAmB;QACvC,MAAM,cAAc,GAAG,IAAI,qBAAS,EAAE,CAAC;QAEvC;;WAEG;QACH,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,eAAe;QACzC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,mBAAmB;QAE7D;;WAEG;QACH,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACzB,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,mCAAmC;YACzE,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,8CAA8C;YAEpF,gDAAgD;YAChD;;;;;;;;cAQE;YACF,cAAc,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,IAAI,cAAc,CAAC,CAAC,CAAC,6BAA6B;YAEpF,+BAA+B;YAC/B,IAAI,KAAK,GAAG,CAAC,CAAC;YACd,IAAI,KAAK,CAAC,KAAK,EAAE;gBACb,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO;oBAAE,KAAK,IAAI,GAAG,CAAC;gBACtC,IAAI,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC;oBAAE,KAAK,IAAI,GAAG,CAAC;gBACzC,IAAI,KAAK,CAAC,KAAK,CAAC,cAAc;oBAAE,KAAK,IAAI,GAAG,CAAC;gBAC7C,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK;oBAAE,KAAK,IAAI,GAAG,CAAC;aACvC;YACD,cAAc,CA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D,4CAyMC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { WarResult, JsonResult } from '../CommonInterfaces';
|
|
3
|
+
export declare abstract class StringsTranslator {
|
|
4
|
+
static jsonToWar(stringsJson: object): WarResult;
|
|
5
|
+
static warToJson(buffer: Buffer): JsonResult<object>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=StringsTranslator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringsTranslator.d.ts","sourceRoot":"","sources":["../../../src/translators/StringsTranslator.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAE3D,8BAAsB,iBAAiB;WAErB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,SAAS;WAwBzC,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;CAmB9D"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const outBufferToWar = new HexBuffer();
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StringsTranslator = void 0;
|
|
4
|
+
const HexBuffer_1 = require("../HexBuffer");
|
|
5
|
+
class StringsTranslator {
|
|
6
|
+
static jsonToWar(stringsJson) {
|
|
7
|
+
const outBufferToWar = new HexBuffer_1.HexBuffer();
|
|
9
8
|
/*
|
|
10
9
|
* Strings
|
|
11
10
|
*/
|
|
@@ -20,30 +19,26 @@ export abstract class StringsTranslator {
|
|
|
20
19
|
outBufferToWar.addNewLine();
|
|
21
20
|
outBufferToWar.addNewLine();
|
|
22
21
|
});
|
|
23
|
-
|
|
24
22
|
return {
|
|
25
23
|
errors: [],
|
|
26
24
|
buffer: outBufferToWar.getBuffer()
|
|
27
25
|
};
|
|
28
26
|
}
|
|
29
|
-
|
|
30
|
-
public static warToJson(buffer: Buffer): JsonResult<object> {
|
|
27
|
+
static warToJson(buffer) {
|
|
31
28
|
const wts = buffer.toString().replace(/\r\n/g, '\n'), // may contain Windows linebreaks (\r\n), but below regex just assumes \n
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
matchStringDefinitionBlock = new RegExp('STRING ([0-9]+)\n?(?:.*\n)?\{\n((?:.|\n)*?)\n}', 'g'); // see: https://regexr.com/3r572
|
|
34
30
|
const result = {}; // stores the json form of strings file
|
|
35
31
|
let match; // stores individual matches as input is read
|
|
36
|
-
|
|
37
32
|
// tslint:disable-next-line: no-conditional-assignment
|
|
38
33
|
while ((match = matchStringDefinitionBlock.exec(wts)) !== null) {
|
|
39
|
-
const num = match[1],
|
|
40
|
-
body = match[2];
|
|
34
|
+
const num = match[1], body = match[2];
|
|
41
35
|
result[num] = body;
|
|
42
36
|
}
|
|
43
|
-
|
|
44
37
|
return {
|
|
45
38
|
errors: [],
|
|
46
39
|
json: result
|
|
47
40
|
};
|
|
48
41
|
}
|
|
49
42
|
}
|
|
43
|
+
exports.StringsTranslator = StringsTranslator;
|
|
44
|
+
//# sourceMappingURL=StringsTranslator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringsTranslator.js","sourceRoot":"","sources":["../../../src/translators/StringsTranslator.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AAGzC,MAAsB,iBAAiB;IAE5B,MAAM,CAAC,SAAS,CAAC,WAAmB;QACvC,MAAM,cAAc,GAAG,IAAI,qBAAS,EAAE,CAAC;QAEvC;;WAEG;QACH,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACrC,cAAc,CAAC,QAAQ,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC;YACzC,cAAc,CAAC,UAAU,EAAE,CAAC;YAC5B,cAAc,CAAC,QA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set: string;
|
|
5
|
+
customTileset: boolean;
|
|
6
|
+
tilePalette: string[];
|
|
7
|
+
cliffTilePalette: string[];
|
|
8
|
+
map: Map;
|
|
9
|
+
groundHeight: number[];
|
|
10
|
+
waterHeight: number[];
|
|
11
|
+
boundaryFlag: boolean[];
|
|
12
|
+
flags: number[];
|
|
13
|
+
groundTexture: number[];
|
|
14
|
+
groundVariation: number[];
|
|
15
|
+
cliffVariation: number[];
|
|
16
|
+
cliffTexture: number[];
|
|
17
|
+
layerHeight: number[];
|
|
18
|
+
}
|
|
19
|
+
interface Map {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
offset: Offset;
|
|
23
|
+
}
|
|
24
|
+
interface Offset {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}
|
|
28
|
+
export declare abstract class TerrainTranslator {
|
|
29
|
+
static jsonToWar(terrainJson: Terrain): WarResult;
|
|
30
|
+
static warToJson(buffer: Buffer): JsonResult<Terrain>;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=TerrainTranslator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerrainTranslator.d.ts","sourceRoot":"","sources":["../../../src/translators/TerrainTranslator.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAE3D,UAAU,OAAO;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,GAAG,EAAE,GAAG,CAAC;IAET,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,EAAE,OAAO,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAA;CACxB;AAED,UAAU,GAAG;IACT,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,MAAM;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACb;AAUD,8BAAsB,iBAAiB;WAErB,SAAS,CAAC,WAAW,EAAE,OAAO,GAAG,SAAS;WA+F1C,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC;CAyI/D"}
|
|
@@ -1,49 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
customTileset: boolean;
|
|
8
|
-
tilePalette: string[];
|
|
9
|
-
cliffTilePalette: string[];
|
|
10
|
-
map: Map;
|
|
11
|
-
// "Masks"
|
|
12
|
-
groundHeight: number[],
|
|
13
|
-
waterHeight: number[],
|
|
14
|
-
boundaryFlag: boolean[],
|
|
15
|
-
flags: number[],
|
|
16
|
-
groundTexture: number[],
|
|
17
|
-
groundVariation: number[],
|
|
18
|
-
cliffVariation: number[],
|
|
19
|
-
cliffTexture: number[],
|
|
20
|
-
layerHeight: number[]
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
interface Map {
|
|
24
|
-
width: number;
|
|
25
|
-
height: number;
|
|
26
|
-
offset: Offset;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface Offset {
|
|
30
|
-
x: number;
|
|
31
|
-
y: number;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function splitLargeArrayIntoWidthArrays(array: any[], width: number) {
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerrainTranslator = void 0;
|
|
4
|
+
const HexBuffer_1 = require("../HexBuffer");
|
|
5
|
+
const W3Buffer_1 = require("../W3Buffer");
|
|
6
|
+
function splitLargeArrayIntoWidthArrays(array, width) {
|
|
35
7
|
const rows = [];
|
|
36
|
-
for(let i = 0; i < array.length / width; i++) {
|
|
37
|
-
rows.push(array.slice(i * width, (i+1) * width));
|
|
8
|
+
for (let i = 0; i < array.length / width; i++) {
|
|
9
|
+
rows.push(array.slice(i * width, (i + 1) * width));
|
|
38
10
|
}
|
|
39
11
|
return rows;
|
|
40
12
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
public static jsonToWar(terrainJson: Terrain): WarResult {
|
|
45
|
-
const outBufferToWar = new HexBuffer();
|
|
46
|
-
|
|
13
|
+
class TerrainTranslator {
|
|
14
|
+
static jsonToWar(terrainJson) {
|
|
15
|
+
const outBufferToWar = new HexBuffer_1.HexBuffer();
|
|
47
16
|
/*
|
|
48
17
|
* Header
|
|
49
18
|
*/
|
|
@@ -51,7 +20,6 @@ export abstract class TerrainTranslator {
|
|
|
51
20
|
outBufferToWar.addInt(11); // file version
|
|
52
21
|
outBufferToWar.addChar(terrainJson.tileset); // base tileset
|
|
53
22
|
outBufferToWar.addInt(+terrainJson.customTileset); // 1 = using custom tileset, 0 = not
|
|
54
|
-
|
|
55
23
|
/*
|
|
56
24
|
* Tiles
|
|
57
25
|
*/
|
|
@@ -59,7 +27,6 @@ export abstract class TerrainTranslator {
|
|
|
59
27
|
terrainJson.tilePalette.forEach((tile) => {
|
|
60
28
|
outBufferToWar.addChars(tile);
|
|
61
29
|
});
|
|
62
|
-
|
|
63
30
|
/*
|
|
64
31
|
* Cliffs
|
|
65
32
|
*/
|
|
@@ -67,19 +34,16 @@ export abstract class TerrainTranslator {
|
|
|
67
34
|
terrainJson.cliffTilePalette.forEach((cliffTile) => {
|
|
68
35
|
outBufferToWar.addChars(cliffTile);
|
|
69
36
|
});
|
|
70
|
-
|
|
71
37
|
/*
|
|
72
38
|
* Map size data
|
|
73
39
|
*/
|
|
74
40
|
outBufferToWar.addInt(terrainJson.map.width + 1);
|
|
75
41
|
outBufferToWar.addInt(terrainJson.map.height + 1);
|
|
76
|
-
|
|
77
42
|
/*
|
|
78
43
|
* Map offset
|
|
79
44
|
*/
|
|
80
45
|
outBufferToWar.addFloat(terrainJson.map.offset.x);
|
|
81
46
|
outBufferToWar.addFloat(terrainJson.map.offset.y);
|
|
82
|
-
|
|
83
47
|
/*
|
|
84
48
|
* Tile points
|
|
85
49
|
*/
|
|
@@ -96,7 +60,6 @@ export abstract class TerrainTranslator {
|
|
|
96
60
|
cliffTexture: splitLargeArrayIntoWidthArrays(terrainJson.cliffTexture, terrainJson.map.width + 1),
|
|
97
61
|
layerHeight: splitLargeArrayIntoWidthArrays(terrainJson.layerHeight, terrainJson.map.width + 1)
|
|
98
62
|
};
|
|
99
|
-
|
|
100
63
|
rows.groundHeight.reverse();
|
|
101
64
|
rows.waterHeight.reverse();
|
|
102
65
|
rows.boundaryFlag.reverse();
|
|
@@ -106,9 +69,8 @@ export abstract class TerrainTranslator {
|
|
|
106
69
|
rows.cliffVariation.reverse();
|
|
107
70
|
rows.cliffTexture.reverse();
|
|
108
71
|
rows.layerHeight.reverse();
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
for(let j = 0; j < rows.groundHeight[i].length; j++) {
|
|
72
|
+
for (let i = 0; i < rows.groundHeight.length; i++) {
|
|
73
|
+
for (let j = 0; j < rows.groundHeight[i].length; j++) {
|
|
112
74
|
// these bit operations are based off documentation from https://github.com/stijnherfst/HiveWE/wiki/war3map.w3e-Terrain
|
|
113
75
|
const groundHeight = rows.groundHeight[i][j];
|
|
114
76
|
const waterHeight = rows.waterHeight[i][j];
|
|
@@ -119,9 +81,7 @@ export abstract class TerrainTranslator {
|
|
|
119
81
|
const cliffVariation = rows.cliffVariation[i][j];
|
|
120
82
|
const cliffTexture = rows.cliffTexture[i][j];
|
|
121
83
|
const layerHeight = rows.layerHeight[i][j];
|
|
122
|
-
|
|
123
84
|
const hasBoundaryFlag = boundaryFlag ? 0x4000 : 0;
|
|
124
|
-
|
|
125
85
|
outBufferToWar.addShort(groundHeight);
|
|
126
86
|
outBufferToWar.addShort(waterHeight | hasBoundaryFlag);
|
|
127
87
|
outBufferToWar.addByte(flags | groundTexture);
|
|
@@ -129,16 +89,14 @@ export abstract class TerrainTranslator {
|
|
|
129
89
|
outBufferToWar.addByte(cliffTexture | layerHeight);
|
|
130
90
|
}
|
|
131
91
|
}
|
|
132
|
-
|
|
133
92
|
return {
|
|
134
93
|
errors: [],
|
|
135
94
|
buffer: outBufferToWar.getBuffer()
|
|
136
95
|
};
|
|
137
96
|
}
|
|
138
|
-
|
|
139
|
-
public static warToJson(buffer: Buffer): JsonResult<Terrain> {
|
|
97
|
+
static warToJson(buffer) {
|
|
140
98
|
// create buffer
|
|
141
|
-
const result
|
|
99
|
+
const result = {
|
|
142
100
|
tileset: '',
|
|
143
101
|
customTileset: false,
|
|
144
102
|
tilePalette: [],
|
|
@@ -161,8 +119,7 @@ export abstract class TerrainTranslator {
|
|
|
161
119
|
cliffTexture: [],
|
|
162
120
|
layerHeight: []
|
|
163
121
|
};
|
|
164
|
-
const outBufferToJSON = new W3Buffer(buffer);
|
|
165
|
-
|
|
122
|
+
const outBufferToJSON = new W3Buffer_1.W3Buffer(buffer);
|
|
166
123
|
/**
|
|
167
124
|
* Header
|
|
168
125
|
*/
|
|
@@ -170,10 +127,8 @@ export abstract class TerrainTranslator {
|
|
|
170
127
|
const version = outBufferToJSON.readInt(); // 0B 00 00 00
|
|
171
128
|
const tileset = outBufferToJSON.readChars(1); // tileset
|
|
172
129
|
const customTileset = (outBufferToJSON.readInt() === 1);
|
|
173
|
-
|
|
174
130
|
result.tileset = tileset;
|
|
175
131
|
result.customTileset = customTileset;
|
|
176
|
-
|
|
177
132
|
/**
|
|
178
133
|
* Tiles
|
|
179
134
|
*/
|
|
@@ -182,9 +137,7 @@ export abstract class TerrainTranslator {
|
|
|
182
137
|
for (let i = 0; i < numTilePalettes; i++) {
|
|
183
138
|
tilePalettes.push(outBufferToJSON.readChars(4));
|
|
184
139
|
}
|
|
185
|
-
|
|
186
140
|
result.tilePalette = tilePalettes;
|
|
187
|
-
|
|
188
141
|
/**
|
|
189
142
|
* Cliffs
|
|
190
143
|
*/
|
|
@@ -194,20 +147,16 @@ export abstract class TerrainTranslator {
|
|
|
194
147
|
const cliffPalette = outBufferToJSON.readChars(4);
|
|
195
148
|
cliffPalettes.push(cliffPalette);
|
|
196
149
|
}
|
|
197
|
-
|
|
198
150
|
result.cliffTilePalette = cliffPalettes;
|
|
199
|
-
|
|
200
151
|
/**
|
|
201
152
|
* map dimensions
|
|
202
153
|
*/
|
|
203
154
|
const width = outBufferToJSON.readInt() - 1;
|
|
204
155
|
const height = outBufferToJSON.readInt() - 1;
|
|
205
156
|
result.map = { width, height, offset: { x: 0, y: 0 } };
|
|
206
|
-
|
|
207
157
|
const offsetX = outBufferToJSON.readFloat();
|
|
208
158
|
const offsetY = outBufferToJSON.readFloat();
|
|
209
159
|
result.map.offset = { x: offsetX, y: offsetY };
|
|
210
|
-
|
|
211
160
|
/**
|
|
212
161
|
* map tiles
|
|
213
162
|
*/
|
|
@@ -220,14 +169,12 @@ export abstract class TerrainTranslator {
|
|
|
220
169
|
const arr_cliffVariation = [];
|
|
221
170
|
const arr_cliffTexture = [];
|
|
222
171
|
const arr_layerHeight = [];
|
|
223
|
-
|
|
224
|
-
while(!outBufferToJSON.isExhausted()) {
|
|
172
|
+
while (!outBufferToJSON.isExhausted()) {
|
|
225
173
|
const groundHeight = outBufferToJSON.readShort();
|
|
226
174
|
const waterHeightAndBoundary = outBufferToJSON.readShort();
|
|
227
175
|
const flagsAndGroundTexture = outBufferToJSON.readByte();
|
|
228
176
|
const groundAndCliffVariation = outBufferToJSON.readByte();
|
|
229
177
|
const cliffTextureAndLayerHeight = outBufferToJSON.readByte();
|
|
230
|
-
|
|
231
178
|
// parse out different bits (based on documentation from https://github.com/stijnherfst/HiveWE/wiki/war3map.w3e-Terrain)
|
|
232
179
|
const waterHeight = waterHeightAndBoundary & 32767;
|
|
233
180
|
const boundaryFlag = (waterHeightAndBoundary & 0x4000) === 0x4000;
|
|
@@ -237,7 +184,6 @@ export abstract class TerrainTranslator {
|
|
|
237
184
|
const cliffVariation = groundAndCliffVariation & 7;
|
|
238
185
|
const cliffTexture = cliffTextureAndLayerHeight & 240;
|
|
239
186
|
const layerHeight = cliffTextureAndLayerHeight & 15;
|
|
240
|
-
|
|
241
187
|
arr_groundHeight.push(groundHeight);
|
|
242
188
|
arr_waterHeight.push(waterHeight);
|
|
243
189
|
arr_boundaryFlag.push(boundaryFlag);
|
|
@@ -248,29 +194,28 @@ export abstract class TerrainTranslator {
|
|
|
248
194
|
arr_cliffTexture.push(cliffTexture);
|
|
249
195
|
arr_layerHeight.push(layerHeight);
|
|
250
196
|
}
|
|
251
|
-
|
|
252
197
|
function convertArrayOfArraysIntoFlatArray(arr) {
|
|
253
198
|
return arr.reduce((a, b) => {
|
|
254
|
-
return [...a, ...b]
|
|
199
|
+
return [...a, ...b];
|
|
255
200
|
});
|
|
256
201
|
}
|
|
257
|
-
|
|
258
202
|
// The map was read in "backwards" because wc3 maps have origin (0,0)
|
|
259
203
|
// at the bottom left instead of top left as we desire. Flip the rows
|
|
260
204
|
// vertically to fix this.
|
|
261
|
-
result.groundHeight = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_groundHeight, result.map.width + 1).reverse())
|
|
262
|
-
result.waterHeight = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_waterHeight, result.map.width + 1).reverse())
|
|
263
|
-
result.boundaryFlag = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_boundaryFlag, result.map.width + 1).reverse())
|
|
264
|
-
result.flags = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_flags, result.map.width + 1).reverse())
|
|
265
|
-
result.groundTexture = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_groundTexture, result.map.width + 1).reverse())
|
|
266
|
-
result.groundVariation = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_groundVariation, result.map.width + 1).reverse())
|
|
267
|
-
result.cliffVariation = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_cliffVariation, result.map.width + 1).reverse())
|
|
268
|
-
result.cliffTexture = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_cliffTexture, result.map.width + 1).reverse())
|
|
269
|
-
result.layerHeight = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_layerHeight, result.map.width + 1).reverse())
|
|
270
|
-
|
|
205
|
+
result.groundHeight = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_groundHeight, result.map.width + 1).reverse());
|
|
206
|
+
result.waterHeight = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_waterHeight, result.map.width + 1).reverse());
|
|
207
|
+
result.boundaryFlag = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_boundaryFlag, result.map.width + 1).reverse());
|
|
208
|
+
result.flags = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_flags, result.map.width + 1).reverse());
|
|
209
|
+
result.groundTexture = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_groundTexture, result.map.width + 1).reverse());
|
|
210
|
+
result.groundVariation = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_groundVariation, result.map.width + 1).reverse());
|
|
211
|
+
result.cliffVariation = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_cliffVariation, result.map.width + 1).reverse());
|
|
212
|
+
result.cliffTexture = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_cliffTexture, result.map.width + 1).reverse());
|
|
213
|
+
result.layerHeight = convertArrayOfArraysIntoFlatArray(splitLargeArrayIntoWidthArrays(arr_layerHeight, result.map.width + 1).reverse());
|
|
271
214
|
return {
|
|
272
215
|
errors: [],
|
|
273
216
|
json: result
|
|
274
217
|
};
|
|
275
218
|
}
|
|
276
219
|
}
|
|
220
|
+
exports.TerrainTranslator = TerrainTranslator;
|
|
221
|
+
//# sourceMappingURL=TerrainTranslator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TerrainTranslator.js","sourceRoot":"","sources":["../../../src/translators/TerrainTranslator.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AACzC,0CAAuC;AAgCvC,SAAS,8BAA8B,CAAC,KAAY,EAAE,KAAa;IAC/D,MAAM,IAAI,GAAG,EAAE,CAAC;IAChB,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,GAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;KACpD;IACD,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,MAAsB,iBAAiB;IAE5B,MAAM,CAAC,SAAS,CAAC,WAAoB;QACxC,MAAM,cAAc,GAAG,IAAI,qBAAS,EAAE,CAAC;QAEvC;;WAEG;QACH,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU;QAC3C,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe;QAC1C,cAAc,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;QAC5D,cAAc,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC,CAAC,oCAAoC;Q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