@world-engines/protocol-ts 0.1.0-alpha.0
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/LICENSE +46 -0
- package/dist/entity-prop-envelope.d.ts +36 -0
- package/dist/entity-prop-envelope.js +50 -0
- package/dist/gen/v1/auth.d.ts +46 -0
- package/dist/gen/v1/auth.js +278 -0
- package/dist/gen/v1/billing.d.ts +71 -0
- package/dist/gen/v1/billing.js +521 -0
- package/dist/gen/v1/common.d.ts +65 -0
- package/dist/gen/v1/common.js +387 -0
- package/dist/gen/v1/llm.d.ts +317 -0
- package/dist/gen/v1/llm.js +3557 -0
- package/dist/gen/v1/mcp.d.ts +373 -0
- package/dist/gen/v1/mcp.js +3190 -0
- package/dist/gen/v1/moderation.d.ts +51 -0
- package/dist/gen/v1/moderation.js +368 -0
- package/dist/gen/v1/neutral_scenario_source.d.ts +80 -0
- package/dist/gen/v1/neutral_scenario_source.js +569 -0
- package/dist/gen/v1/relation_kind.d.ts +105 -0
- package/dist/gen/v1/relation_kind.js +562 -0
- package/dist/gen/v1/rest/admin.d.ts +432 -0
- package/dist/gen/v1/rest/admin.js +4957 -0
- package/dist/gen/v1/rest/asset.d.ts +205 -0
- package/dist/gen/v1/rest/asset.js +2200 -0
- package/dist/gen/v1/rest/auth.d.ts +275 -0
- package/dist/gen/v1/rest/auth.js +2896 -0
- package/dist/gen/v1/rest/billing.d.ts +101 -0
- package/dist/gen/v1/rest/billing.js +866 -0
- package/dist/gen/v1/rest/common.d.ts +179 -0
- package/dist/gen/v1/rest/common.js +1358 -0
- package/dist/gen/v1/rest/creator.d.ts +354 -0
- package/dist/gen/v1/rest/creator.js +4169 -0
- package/dist/gen/v1/rest/messaging.d.ts +190 -0
- package/dist/gen/v1/rest/messaging.js +2017 -0
- package/dist/gen/v1/rest/moderation.d.ts +61 -0
- package/dist/gen/v1/rest/moderation.js +569 -0
- package/dist/gen/v1/rest/pet.d.ts +98 -0
- package/dist/gen/v1/rest/pet.js +698 -0
- package/dist/gen/v1/rest/project_transfer.d.ts +470 -0
- package/dist/gen/v1/rest/project_transfer.js +5266 -0
- package/dist/gen/v1/rest/scenario.d.ts +756 -0
- package/dist/gen/v1/rest/scenario.js +8768 -0
- package/dist/gen/v1/rest/stock_bounty.d.ts +154 -0
- package/dist/gen/v1/rest/stock_bounty.js +1547 -0
- package/dist/gen/v1/rest/stocks.d.ts +465 -0
- package/dist/gen/v1/rest/stocks.js +5200 -0
- package/dist/gen/v1/rest/support_ticket.d.ts +61 -0
- package/dist/gen/v1/rest/support_ticket.js +511 -0
- package/dist/gen/v1/rest/users.d.ts +292 -0
- package/dist/gen/v1/rest/users.js +2879 -0
- package/dist/gen/v1/rest/violations.d.ts +52 -0
- package/dist/gen/v1/rest/violations.js +338 -0
- package/dist/gen/v1/sav.d.ts +987 -0
- package/dist/gen/v1/sav.js +12327 -0
- package/dist/gen/v1/save.d.ts +68 -0
- package/dist/gen/v1/save.js +595 -0
- package/dist/gen/v1/scenario_part_source.d.ts +94 -0
- package/dist/gen/v1/scenario_part_source.js +913 -0
- package/dist/gen/v1/session.d.ts +49 -0
- package/dist/gen/v1/session.js +311 -0
- package/dist/gen/v1/view_state.d.ts +267 -0
- package/dist/gen/v1/view_state.js +3239 -0
- package/dist/gen/v1/world.d.ts +82 -0
- package/dist/gen/v1/world.js +707 -0
- package/dist/gen/v1/world_memory.d.ts +545 -0
- package/dist/gen/v1/world_memory.js +5816 -0
- package/dist/gen/v1/world_memory_privacy.d.ts +96 -0
- package/dist/gen/v1/world_memory_privacy.js +994 -0
- package/dist/gen/v1/ws_frame.d.ts +1626 -0
- package/dist/gen/v1/ws_frame.js +18253 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/ladybug-extraction.d.ts +36 -0
- package/dist/ladybug-extraction.js +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,913 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.12.0
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: v1/scenario_part_source.proto
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
8
|
+
export var SpatialTopologyV1_Kind;
|
|
9
|
+
(function (SpatialTopologyV1_Kind) {
|
|
10
|
+
SpatialTopologyV1_Kind[SpatialTopologyV1_Kind["KIND_UNSPECIFIED"] = 0] = "KIND_UNSPECIFIED";
|
|
11
|
+
SpatialTopologyV1_Kind[SpatialTopologyV1_Kind["KIND_SPHERE"] = 1] = "KIND_SPHERE";
|
|
12
|
+
SpatialTopologyV1_Kind[SpatialTopologyV1_Kind["KIND_PLANE"] = 2] = "KIND_PLANE";
|
|
13
|
+
SpatialTopologyV1_Kind[SpatialTopologyV1_Kind["KIND_RING"] = 3] = "KIND_RING";
|
|
14
|
+
SpatialTopologyV1_Kind[SpatialTopologyV1_Kind["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
15
|
+
})(SpatialTopologyV1_Kind || (SpatialTopologyV1_Kind = {}));
|
|
16
|
+
export function spatialTopologyV1_KindFromJSON(object) {
|
|
17
|
+
switch (object) {
|
|
18
|
+
case 0:
|
|
19
|
+
case "KIND_UNSPECIFIED":
|
|
20
|
+
return SpatialTopologyV1_Kind.KIND_UNSPECIFIED;
|
|
21
|
+
case 1:
|
|
22
|
+
case "KIND_SPHERE":
|
|
23
|
+
return SpatialTopologyV1_Kind.KIND_SPHERE;
|
|
24
|
+
case 2:
|
|
25
|
+
case "KIND_PLANE":
|
|
26
|
+
return SpatialTopologyV1_Kind.KIND_PLANE;
|
|
27
|
+
case 3:
|
|
28
|
+
case "KIND_RING":
|
|
29
|
+
return SpatialTopologyV1_Kind.KIND_RING;
|
|
30
|
+
case -1:
|
|
31
|
+
case "UNRECOGNIZED":
|
|
32
|
+
default:
|
|
33
|
+
return SpatialTopologyV1_Kind.UNRECOGNIZED;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function spatialTopologyV1_KindToJSON(object) {
|
|
37
|
+
switch (object) {
|
|
38
|
+
case SpatialTopologyV1_Kind.KIND_UNSPECIFIED:
|
|
39
|
+
return "KIND_UNSPECIFIED";
|
|
40
|
+
case SpatialTopologyV1_Kind.KIND_SPHERE:
|
|
41
|
+
return "KIND_SPHERE";
|
|
42
|
+
case SpatialTopologyV1_Kind.KIND_PLANE:
|
|
43
|
+
return "KIND_PLANE";
|
|
44
|
+
case SpatialTopologyV1_Kind.KIND_RING:
|
|
45
|
+
return "KIND_RING";
|
|
46
|
+
case SpatialTopologyV1_Kind.UNRECOGNIZED:
|
|
47
|
+
default:
|
|
48
|
+
return "UNRECOGNIZED";
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function createBaseScenarioPartSourceV1() {
|
|
52
|
+
return {
|
|
53
|
+
schema_version: 0,
|
|
54
|
+
metadata: new Uint8Array(0),
|
|
55
|
+
logical_graph: new Uint8Array(0),
|
|
56
|
+
trigger_semantics: new Uint8Array(0),
|
|
57
|
+
layout: new Uint8Array(0),
|
|
58
|
+
resource_refs: new Uint8Array(0),
|
|
59
|
+
prompt_retrieval: new Uint8Array(0),
|
|
60
|
+
spatial_world: undefined,
|
|
61
|
+
_unknownFields: {},
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export const ScenarioPartSourceV1 = {
|
|
65
|
+
encode(message, writer = new BinaryWriter()) {
|
|
66
|
+
if (message.schema_version !== 0) {
|
|
67
|
+
writer.uint32(8).uint32(message.schema_version);
|
|
68
|
+
}
|
|
69
|
+
if (message.metadata.length !== 0) {
|
|
70
|
+
writer.uint32(18).bytes(message.metadata);
|
|
71
|
+
}
|
|
72
|
+
if (message.logical_graph.length !== 0) {
|
|
73
|
+
writer.uint32(26).bytes(message.logical_graph);
|
|
74
|
+
}
|
|
75
|
+
if (message.trigger_semantics.length !== 0) {
|
|
76
|
+
writer.uint32(34).bytes(message.trigger_semantics);
|
|
77
|
+
}
|
|
78
|
+
if (message.layout.length !== 0) {
|
|
79
|
+
writer.uint32(42).bytes(message.layout);
|
|
80
|
+
}
|
|
81
|
+
if (message.resource_refs.length !== 0) {
|
|
82
|
+
writer.uint32(50).bytes(message.resource_refs);
|
|
83
|
+
}
|
|
84
|
+
if (message.prompt_retrieval.length !== 0) {
|
|
85
|
+
writer.uint32(58).bytes(message.prompt_retrieval);
|
|
86
|
+
}
|
|
87
|
+
if (message.spatial_world !== undefined) {
|
|
88
|
+
SpatialWorldSourceV1.encode(message.spatial_world, writer.uint32(66).fork()).join();
|
|
89
|
+
}
|
|
90
|
+
if (message._unknownFields !== undefined) {
|
|
91
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
92
|
+
const tag = parseInt(key, 10);
|
|
93
|
+
for (const value of values) {
|
|
94
|
+
writer.uint32(tag).raw(value);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return writer;
|
|
99
|
+
},
|
|
100
|
+
decode(input, length) {
|
|
101
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
102
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
103
|
+
const message = createBaseScenarioPartSourceV1();
|
|
104
|
+
while (reader.pos < end) {
|
|
105
|
+
const tag = reader.uint32();
|
|
106
|
+
switch (tag >>> 3) {
|
|
107
|
+
case 1: {
|
|
108
|
+
if (tag !== 8) {
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
message.schema_version = reader.uint32();
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
case 2: {
|
|
115
|
+
if (tag !== 18) {
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
message.metadata = reader.bytes();
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
case 3: {
|
|
122
|
+
if (tag !== 26) {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
message.logical_graph = reader.bytes();
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
case 4: {
|
|
129
|
+
if (tag !== 34) {
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
message.trigger_semantics = reader.bytes();
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
case 5: {
|
|
136
|
+
if (tag !== 42) {
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
message.layout = reader.bytes();
|
|
140
|
+
continue;
|
|
141
|
+
}
|
|
142
|
+
case 6: {
|
|
143
|
+
if (tag !== 50) {
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
message.resource_refs = reader.bytes();
|
|
147
|
+
continue;
|
|
148
|
+
}
|
|
149
|
+
case 7: {
|
|
150
|
+
if (tag !== 58) {
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
message.prompt_retrieval = reader.bytes();
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
case 8: {
|
|
157
|
+
if (tag !== 66) {
|
|
158
|
+
break;
|
|
159
|
+
}
|
|
160
|
+
message.spatial_world = SpatialWorldSourceV1.decode(reader, reader.uint32());
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
const buf = reader.skip(tag & 7);
|
|
168
|
+
const list = message._unknownFields[tag];
|
|
169
|
+
if (list === undefined) {
|
|
170
|
+
message._unknownFields[tag] = [buf];
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
list.push(buf);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
return message;
|
|
177
|
+
},
|
|
178
|
+
fromJSON(object) {
|
|
179
|
+
return {
|
|
180
|
+
schema_version: isSet(object.schemaVersion)
|
|
181
|
+
? globalThis.Number(object.schemaVersion)
|
|
182
|
+
: isSet(object.schema_version)
|
|
183
|
+
? globalThis.Number(object.schema_version)
|
|
184
|
+
: 0,
|
|
185
|
+
metadata: isSet(object.metadata) ? bytesFromBase64(object.metadata) : new Uint8Array(0),
|
|
186
|
+
logical_graph: isSet(object.logicalGraph)
|
|
187
|
+
? bytesFromBase64(object.logicalGraph)
|
|
188
|
+
: isSet(object.logical_graph)
|
|
189
|
+
? bytesFromBase64(object.logical_graph)
|
|
190
|
+
: new Uint8Array(0),
|
|
191
|
+
trigger_semantics: isSet(object.triggerSemantics)
|
|
192
|
+
? bytesFromBase64(object.triggerSemantics)
|
|
193
|
+
: isSet(object.trigger_semantics)
|
|
194
|
+
? bytesFromBase64(object.trigger_semantics)
|
|
195
|
+
: new Uint8Array(0),
|
|
196
|
+
layout: isSet(object.layout) ? bytesFromBase64(object.layout) : new Uint8Array(0),
|
|
197
|
+
resource_refs: isSet(object.resourceRefs)
|
|
198
|
+
? bytesFromBase64(object.resourceRefs)
|
|
199
|
+
: isSet(object.resource_refs)
|
|
200
|
+
? bytesFromBase64(object.resource_refs)
|
|
201
|
+
: new Uint8Array(0),
|
|
202
|
+
prompt_retrieval: isSet(object.promptRetrieval)
|
|
203
|
+
? bytesFromBase64(object.promptRetrieval)
|
|
204
|
+
: isSet(object.prompt_retrieval)
|
|
205
|
+
? bytesFromBase64(object.prompt_retrieval)
|
|
206
|
+
: new Uint8Array(0),
|
|
207
|
+
spatial_world: isSet(object.spatialWorld)
|
|
208
|
+
? SpatialWorldSourceV1.fromJSON(object.spatialWorld)
|
|
209
|
+
: isSet(object.spatial_world)
|
|
210
|
+
? SpatialWorldSourceV1.fromJSON(object.spatial_world)
|
|
211
|
+
: undefined,
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
toJSON(message) {
|
|
215
|
+
const obj = {};
|
|
216
|
+
if (message.schema_version !== 0) {
|
|
217
|
+
obj.schemaVersion = Math.round(message.schema_version);
|
|
218
|
+
}
|
|
219
|
+
if (message.metadata.length !== 0) {
|
|
220
|
+
obj.metadata = base64FromBytes(message.metadata);
|
|
221
|
+
}
|
|
222
|
+
if (message.logical_graph.length !== 0) {
|
|
223
|
+
obj.logicalGraph = base64FromBytes(message.logical_graph);
|
|
224
|
+
}
|
|
225
|
+
if (message.trigger_semantics.length !== 0) {
|
|
226
|
+
obj.triggerSemantics = base64FromBytes(message.trigger_semantics);
|
|
227
|
+
}
|
|
228
|
+
if (message.layout.length !== 0) {
|
|
229
|
+
obj.layout = base64FromBytes(message.layout);
|
|
230
|
+
}
|
|
231
|
+
if (message.resource_refs.length !== 0) {
|
|
232
|
+
obj.resourceRefs = base64FromBytes(message.resource_refs);
|
|
233
|
+
}
|
|
234
|
+
if (message.prompt_retrieval.length !== 0) {
|
|
235
|
+
obj.promptRetrieval = base64FromBytes(message.prompt_retrieval);
|
|
236
|
+
}
|
|
237
|
+
if (message.spatial_world !== undefined) {
|
|
238
|
+
obj.spatialWorld = SpatialWorldSourceV1.toJSON(message.spatial_world);
|
|
239
|
+
}
|
|
240
|
+
return obj;
|
|
241
|
+
},
|
|
242
|
+
create(base) {
|
|
243
|
+
return ScenarioPartSourceV1.fromPartial(base ?? {});
|
|
244
|
+
},
|
|
245
|
+
fromPartial(object) {
|
|
246
|
+
const message = createBaseScenarioPartSourceV1();
|
|
247
|
+
message.schema_version = object.schema_version ?? 0;
|
|
248
|
+
message.metadata = object.metadata ?? new Uint8Array(0);
|
|
249
|
+
message.logical_graph = object.logical_graph ?? new Uint8Array(0);
|
|
250
|
+
message.trigger_semantics = object.trigger_semantics ?? new Uint8Array(0);
|
|
251
|
+
message.layout = object.layout ?? new Uint8Array(0);
|
|
252
|
+
message.resource_refs = object.resource_refs ?? new Uint8Array(0);
|
|
253
|
+
message.prompt_retrieval = object.prompt_retrieval ?? new Uint8Array(0);
|
|
254
|
+
message.spatial_world = (object.spatial_world !== undefined && object.spatial_world !== null)
|
|
255
|
+
? SpatialWorldSourceV1.fromPartial(object.spatial_world)
|
|
256
|
+
: undefined;
|
|
257
|
+
return message;
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
function createBaseSpatialWorldSourceV1() {
|
|
261
|
+
return {
|
|
262
|
+
schema_version: 0,
|
|
263
|
+
generation_seed: "",
|
|
264
|
+
topology: undefined,
|
|
265
|
+
planet_generation_settings: new Uint8Array(0),
|
|
266
|
+
biome_rules: [],
|
|
267
|
+
overlay_layers: [],
|
|
268
|
+
cities: [],
|
|
269
|
+
parcels: [],
|
|
270
|
+
buildings: [],
|
|
271
|
+
rooms: [],
|
|
272
|
+
apertures: [],
|
|
273
|
+
preset_overrides: [],
|
|
274
|
+
asset_refs: [],
|
|
275
|
+
_unknownFields: {},
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
export const SpatialWorldSourceV1 = {
|
|
279
|
+
encode(message, writer = new BinaryWriter()) {
|
|
280
|
+
if (message.schema_version !== 0) {
|
|
281
|
+
writer.uint32(8).uint32(message.schema_version);
|
|
282
|
+
}
|
|
283
|
+
if (message.generation_seed !== "") {
|
|
284
|
+
writer.uint32(18).string(message.generation_seed);
|
|
285
|
+
}
|
|
286
|
+
if (message.topology !== undefined) {
|
|
287
|
+
SpatialTopologyV1.encode(message.topology, writer.uint32(26).fork()).join();
|
|
288
|
+
}
|
|
289
|
+
if (message.planet_generation_settings.length !== 0) {
|
|
290
|
+
writer.uint32(34).bytes(message.planet_generation_settings);
|
|
291
|
+
}
|
|
292
|
+
for (const v of message.biome_rules) {
|
|
293
|
+
writer.uint32(42).bytes(v);
|
|
294
|
+
}
|
|
295
|
+
for (const v of message.overlay_layers) {
|
|
296
|
+
writer.uint32(50).bytes(v);
|
|
297
|
+
}
|
|
298
|
+
for (const v of message.cities) {
|
|
299
|
+
SpatialObjectV1.encode(v, writer.uint32(58).fork()).join();
|
|
300
|
+
}
|
|
301
|
+
for (const v of message.parcels) {
|
|
302
|
+
SpatialObjectV1.encode(v, writer.uint32(66).fork()).join();
|
|
303
|
+
}
|
|
304
|
+
for (const v of message.buildings) {
|
|
305
|
+
SpatialObjectV1.encode(v, writer.uint32(74).fork()).join();
|
|
306
|
+
}
|
|
307
|
+
for (const v of message.rooms) {
|
|
308
|
+
SpatialObjectV1.encode(v, writer.uint32(82).fork()).join();
|
|
309
|
+
}
|
|
310
|
+
for (const v of message.apertures) {
|
|
311
|
+
SpatialObjectV1.encode(v, writer.uint32(90).fork()).join();
|
|
312
|
+
}
|
|
313
|
+
for (const v of message.preset_overrides) {
|
|
314
|
+
SpatialPresetV1.encode(v, writer.uint32(98).fork()).join();
|
|
315
|
+
}
|
|
316
|
+
for (const v of message.asset_refs) {
|
|
317
|
+
writer.uint32(106).string(v);
|
|
318
|
+
}
|
|
319
|
+
if (message._unknownFields !== undefined) {
|
|
320
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
321
|
+
const tag = parseInt(key, 10);
|
|
322
|
+
for (const value of values) {
|
|
323
|
+
writer.uint32(tag).raw(value);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
return writer;
|
|
328
|
+
},
|
|
329
|
+
decode(input, length) {
|
|
330
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
331
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
332
|
+
const message = createBaseSpatialWorldSourceV1();
|
|
333
|
+
while (reader.pos < end) {
|
|
334
|
+
const tag = reader.uint32();
|
|
335
|
+
switch (tag >>> 3) {
|
|
336
|
+
case 1: {
|
|
337
|
+
if (tag !== 8) {
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
message.schema_version = reader.uint32();
|
|
341
|
+
continue;
|
|
342
|
+
}
|
|
343
|
+
case 2: {
|
|
344
|
+
if (tag !== 18) {
|
|
345
|
+
break;
|
|
346
|
+
}
|
|
347
|
+
message.generation_seed = reader.string();
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
case 3: {
|
|
351
|
+
if (tag !== 26) {
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
message.topology = SpatialTopologyV1.decode(reader, reader.uint32());
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
case 4: {
|
|
358
|
+
if (tag !== 34) {
|
|
359
|
+
break;
|
|
360
|
+
}
|
|
361
|
+
message.planet_generation_settings = reader.bytes();
|
|
362
|
+
continue;
|
|
363
|
+
}
|
|
364
|
+
case 5: {
|
|
365
|
+
if (tag !== 42) {
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
message.biome_rules.push(reader.bytes());
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
case 6: {
|
|
372
|
+
if (tag !== 50) {
|
|
373
|
+
break;
|
|
374
|
+
}
|
|
375
|
+
message.overlay_layers.push(reader.bytes());
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
case 7: {
|
|
379
|
+
if (tag !== 58) {
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
message.cities.push(SpatialObjectV1.decode(reader, reader.uint32()));
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
case 8: {
|
|
386
|
+
if (tag !== 66) {
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
message.parcels.push(SpatialObjectV1.decode(reader, reader.uint32()));
|
|
390
|
+
continue;
|
|
391
|
+
}
|
|
392
|
+
case 9: {
|
|
393
|
+
if (tag !== 74) {
|
|
394
|
+
break;
|
|
395
|
+
}
|
|
396
|
+
message.buildings.push(SpatialObjectV1.decode(reader, reader.uint32()));
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
case 10: {
|
|
400
|
+
if (tag !== 82) {
|
|
401
|
+
break;
|
|
402
|
+
}
|
|
403
|
+
message.rooms.push(SpatialObjectV1.decode(reader, reader.uint32()));
|
|
404
|
+
continue;
|
|
405
|
+
}
|
|
406
|
+
case 11: {
|
|
407
|
+
if (tag !== 90) {
|
|
408
|
+
break;
|
|
409
|
+
}
|
|
410
|
+
message.apertures.push(SpatialObjectV1.decode(reader, reader.uint32()));
|
|
411
|
+
continue;
|
|
412
|
+
}
|
|
413
|
+
case 12: {
|
|
414
|
+
if (tag !== 98) {
|
|
415
|
+
break;
|
|
416
|
+
}
|
|
417
|
+
message.preset_overrides.push(SpatialPresetV1.decode(reader, reader.uint32()));
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
420
|
+
case 13: {
|
|
421
|
+
if (tag !== 106) {
|
|
422
|
+
break;
|
|
423
|
+
}
|
|
424
|
+
message.asset_refs.push(reader.string());
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
429
|
+
break;
|
|
430
|
+
}
|
|
431
|
+
const buf = reader.skip(tag & 7);
|
|
432
|
+
const list = message._unknownFields[tag];
|
|
433
|
+
if (list === undefined) {
|
|
434
|
+
message._unknownFields[tag] = [buf];
|
|
435
|
+
}
|
|
436
|
+
else {
|
|
437
|
+
list.push(buf);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
return message;
|
|
441
|
+
},
|
|
442
|
+
fromJSON(object) {
|
|
443
|
+
return {
|
|
444
|
+
schema_version: isSet(object.schemaVersion)
|
|
445
|
+
? globalThis.Number(object.schemaVersion)
|
|
446
|
+
: isSet(object.schema_version)
|
|
447
|
+
? globalThis.Number(object.schema_version)
|
|
448
|
+
: 0,
|
|
449
|
+
generation_seed: isSet(object.generationSeed)
|
|
450
|
+
? globalThis.String(object.generationSeed)
|
|
451
|
+
: isSet(object.generation_seed)
|
|
452
|
+
? globalThis.String(object.generation_seed)
|
|
453
|
+
: "",
|
|
454
|
+
topology: isSet(object.topology) ? SpatialTopologyV1.fromJSON(object.topology) : undefined,
|
|
455
|
+
planet_generation_settings: isSet(object.planetGenerationSettings)
|
|
456
|
+
? bytesFromBase64(object.planetGenerationSettings)
|
|
457
|
+
: isSet(object.planet_generation_settings)
|
|
458
|
+
? bytesFromBase64(object.planet_generation_settings)
|
|
459
|
+
: new Uint8Array(0),
|
|
460
|
+
biome_rules: globalThis.Array.isArray(object?.biomeRules)
|
|
461
|
+
? object.biomeRules.map((e) => bytesFromBase64(e))
|
|
462
|
+
: globalThis.Array.isArray(object?.biome_rules)
|
|
463
|
+
? object.biome_rules.map((e) => bytesFromBase64(e))
|
|
464
|
+
: [],
|
|
465
|
+
overlay_layers: globalThis.Array.isArray(object?.overlayLayers)
|
|
466
|
+
? object.overlayLayers.map((e) => bytesFromBase64(e))
|
|
467
|
+
: globalThis.Array.isArray(object?.overlay_layers)
|
|
468
|
+
? object.overlay_layers.map((e) => bytesFromBase64(e))
|
|
469
|
+
: [],
|
|
470
|
+
cities: globalThis.Array.isArray(object?.cities)
|
|
471
|
+
? object.cities.map((e) => SpatialObjectV1.fromJSON(e))
|
|
472
|
+
: [],
|
|
473
|
+
parcels: globalThis.Array.isArray(object?.parcels)
|
|
474
|
+
? object.parcels.map((e) => SpatialObjectV1.fromJSON(e))
|
|
475
|
+
: [],
|
|
476
|
+
buildings: globalThis.Array.isArray(object?.buildings)
|
|
477
|
+
? object.buildings.map((e) => SpatialObjectV1.fromJSON(e))
|
|
478
|
+
: [],
|
|
479
|
+
rooms: globalThis.Array.isArray(object?.rooms) ? object.rooms.map((e) => SpatialObjectV1.fromJSON(e)) : [],
|
|
480
|
+
apertures: globalThis.Array.isArray(object?.apertures)
|
|
481
|
+
? object.apertures.map((e) => SpatialObjectV1.fromJSON(e))
|
|
482
|
+
: [],
|
|
483
|
+
preset_overrides: globalThis.Array.isArray(object?.presetOverrides)
|
|
484
|
+
? object.presetOverrides.map((e) => SpatialPresetV1.fromJSON(e))
|
|
485
|
+
: globalThis.Array.isArray(object?.preset_overrides)
|
|
486
|
+
? object.preset_overrides.map((e) => SpatialPresetV1.fromJSON(e))
|
|
487
|
+
: [],
|
|
488
|
+
asset_refs: globalThis.Array.isArray(object?.assetRefs)
|
|
489
|
+
? object.assetRefs.map((e) => globalThis.String(e))
|
|
490
|
+
: globalThis.Array.isArray(object?.asset_refs)
|
|
491
|
+
? object.asset_refs.map((e) => globalThis.String(e))
|
|
492
|
+
: [],
|
|
493
|
+
};
|
|
494
|
+
},
|
|
495
|
+
toJSON(message) {
|
|
496
|
+
const obj = {};
|
|
497
|
+
if (message.schema_version !== 0) {
|
|
498
|
+
obj.schemaVersion = Math.round(message.schema_version);
|
|
499
|
+
}
|
|
500
|
+
if (message.generation_seed !== "") {
|
|
501
|
+
obj.generationSeed = message.generation_seed;
|
|
502
|
+
}
|
|
503
|
+
if (message.topology !== undefined) {
|
|
504
|
+
obj.topology = SpatialTopologyV1.toJSON(message.topology);
|
|
505
|
+
}
|
|
506
|
+
if (message.planet_generation_settings.length !== 0) {
|
|
507
|
+
obj.planetGenerationSettings = base64FromBytes(message.planet_generation_settings);
|
|
508
|
+
}
|
|
509
|
+
if (message.biome_rules?.length) {
|
|
510
|
+
obj.biomeRules = message.biome_rules.map((e) => base64FromBytes(e));
|
|
511
|
+
}
|
|
512
|
+
if (message.overlay_layers?.length) {
|
|
513
|
+
obj.overlayLayers = message.overlay_layers.map((e) => base64FromBytes(e));
|
|
514
|
+
}
|
|
515
|
+
if (message.cities?.length) {
|
|
516
|
+
obj.cities = message.cities.map((e) => SpatialObjectV1.toJSON(e));
|
|
517
|
+
}
|
|
518
|
+
if (message.parcels?.length) {
|
|
519
|
+
obj.parcels = message.parcels.map((e) => SpatialObjectV1.toJSON(e));
|
|
520
|
+
}
|
|
521
|
+
if (message.buildings?.length) {
|
|
522
|
+
obj.buildings = message.buildings.map((e) => SpatialObjectV1.toJSON(e));
|
|
523
|
+
}
|
|
524
|
+
if (message.rooms?.length) {
|
|
525
|
+
obj.rooms = message.rooms.map((e) => SpatialObjectV1.toJSON(e));
|
|
526
|
+
}
|
|
527
|
+
if (message.apertures?.length) {
|
|
528
|
+
obj.apertures = message.apertures.map((e) => SpatialObjectV1.toJSON(e));
|
|
529
|
+
}
|
|
530
|
+
if (message.preset_overrides?.length) {
|
|
531
|
+
obj.presetOverrides = message.preset_overrides.map((e) => SpatialPresetV1.toJSON(e));
|
|
532
|
+
}
|
|
533
|
+
if (message.asset_refs?.length) {
|
|
534
|
+
obj.assetRefs = message.asset_refs;
|
|
535
|
+
}
|
|
536
|
+
return obj;
|
|
537
|
+
},
|
|
538
|
+
create(base) {
|
|
539
|
+
return SpatialWorldSourceV1.fromPartial(base ?? {});
|
|
540
|
+
},
|
|
541
|
+
fromPartial(object) {
|
|
542
|
+
const message = createBaseSpatialWorldSourceV1();
|
|
543
|
+
message.schema_version = object.schema_version ?? 0;
|
|
544
|
+
message.generation_seed = object.generation_seed ?? "";
|
|
545
|
+
message.topology = (object.topology !== undefined && object.topology !== null)
|
|
546
|
+
? SpatialTopologyV1.fromPartial(object.topology)
|
|
547
|
+
: undefined;
|
|
548
|
+
message.planet_generation_settings = object.planet_generation_settings ?? new Uint8Array(0);
|
|
549
|
+
message.biome_rules = object.biome_rules?.map((e) => e) || [];
|
|
550
|
+
message.overlay_layers = object.overlay_layers?.map((e) => e) || [];
|
|
551
|
+
message.cities = object.cities?.map((e) => SpatialObjectV1.fromPartial(e)) || [];
|
|
552
|
+
message.parcels = object.parcels?.map((e) => SpatialObjectV1.fromPartial(e)) || [];
|
|
553
|
+
message.buildings = object.buildings?.map((e) => SpatialObjectV1.fromPartial(e)) || [];
|
|
554
|
+
message.rooms = object.rooms?.map((e) => SpatialObjectV1.fromPartial(e)) || [];
|
|
555
|
+
message.apertures = object.apertures?.map((e) => SpatialObjectV1.fromPartial(e)) || [];
|
|
556
|
+
message.preset_overrides = object.preset_overrides?.map((e) => SpatialPresetV1.fromPartial(e)) || [];
|
|
557
|
+
message.asset_refs = object.asset_refs?.map((e) => e) || [];
|
|
558
|
+
return message;
|
|
559
|
+
},
|
|
560
|
+
};
|
|
561
|
+
function createBaseSpatialTopologyV1() {
|
|
562
|
+
return { kind: 0, settings: new Uint8Array(0), _unknownFields: {} };
|
|
563
|
+
}
|
|
564
|
+
export const SpatialTopologyV1 = {
|
|
565
|
+
encode(message, writer = new BinaryWriter()) {
|
|
566
|
+
if (message.kind !== 0) {
|
|
567
|
+
writer.uint32(8).int32(message.kind);
|
|
568
|
+
}
|
|
569
|
+
if (message.settings.length !== 0) {
|
|
570
|
+
writer.uint32(18).bytes(message.settings);
|
|
571
|
+
}
|
|
572
|
+
if (message._unknownFields !== undefined) {
|
|
573
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
574
|
+
const tag = parseInt(key, 10);
|
|
575
|
+
for (const value of values) {
|
|
576
|
+
writer.uint32(tag).raw(value);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return writer;
|
|
581
|
+
},
|
|
582
|
+
decode(input, length) {
|
|
583
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
584
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
585
|
+
const message = createBaseSpatialTopologyV1();
|
|
586
|
+
while (reader.pos < end) {
|
|
587
|
+
const tag = reader.uint32();
|
|
588
|
+
switch (tag >>> 3) {
|
|
589
|
+
case 1: {
|
|
590
|
+
if (tag !== 8) {
|
|
591
|
+
break;
|
|
592
|
+
}
|
|
593
|
+
message.kind = reader.int32();
|
|
594
|
+
continue;
|
|
595
|
+
}
|
|
596
|
+
case 2: {
|
|
597
|
+
if (tag !== 18) {
|
|
598
|
+
break;
|
|
599
|
+
}
|
|
600
|
+
message.settings = reader.bytes();
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
605
|
+
break;
|
|
606
|
+
}
|
|
607
|
+
const buf = reader.skip(tag & 7);
|
|
608
|
+
const list = message._unknownFields[tag];
|
|
609
|
+
if (list === undefined) {
|
|
610
|
+
message._unknownFields[tag] = [buf];
|
|
611
|
+
}
|
|
612
|
+
else {
|
|
613
|
+
list.push(buf);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return message;
|
|
617
|
+
},
|
|
618
|
+
fromJSON(object) {
|
|
619
|
+
return {
|
|
620
|
+
kind: isSet(object.kind) ? spatialTopologyV1_KindFromJSON(object.kind) : 0,
|
|
621
|
+
settings: isSet(object.settings) ? bytesFromBase64(object.settings) : new Uint8Array(0),
|
|
622
|
+
};
|
|
623
|
+
},
|
|
624
|
+
toJSON(message) {
|
|
625
|
+
const obj = {};
|
|
626
|
+
if (message.kind !== 0) {
|
|
627
|
+
obj.kind = spatialTopologyV1_KindToJSON(message.kind);
|
|
628
|
+
}
|
|
629
|
+
if (message.settings.length !== 0) {
|
|
630
|
+
obj.settings = base64FromBytes(message.settings);
|
|
631
|
+
}
|
|
632
|
+
return obj;
|
|
633
|
+
},
|
|
634
|
+
create(base) {
|
|
635
|
+
return SpatialTopologyV1.fromPartial(base ?? {});
|
|
636
|
+
},
|
|
637
|
+
fromPartial(object) {
|
|
638
|
+
const message = createBaseSpatialTopologyV1();
|
|
639
|
+
message.kind = object.kind ?? 0;
|
|
640
|
+
message.settings = object.settings ?? new Uint8Array(0);
|
|
641
|
+
return message;
|
|
642
|
+
},
|
|
643
|
+
};
|
|
644
|
+
function createBaseSpatialObjectV1() {
|
|
645
|
+
return {
|
|
646
|
+
spatial_id: "",
|
|
647
|
+
parent_spatial_id: "",
|
|
648
|
+
label: "",
|
|
649
|
+
author_settings: new Uint8Array(0),
|
|
650
|
+
asset_refs: [],
|
|
651
|
+
_unknownFields: {},
|
|
652
|
+
};
|
|
653
|
+
}
|
|
654
|
+
export const SpatialObjectV1 = {
|
|
655
|
+
encode(message, writer = new BinaryWriter()) {
|
|
656
|
+
if (message.spatial_id !== "") {
|
|
657
|
+
writer.uint32(10).string(message.spatial_id);
|
|
658
|
+
}
|
|
659
|
+
if (message.parent_spatial_id !== "") {
|
|
660
|
+
writer.uint32(18).string(message.parent_spatial_id);
|
|
661
|
+
}
|
|
662
|
+
if (message.label !== "") {
|
|
663
|
+
writer.uint32(26).string(message.label);
|
|
664
|
+
}
|
|
665
|
+
if (message.author_settings.length !== 0) {
|
|
666
|
+
writer.uint32(34).bytes(message.author_settings);
|
|
667
|
+
}
|
|
668
|
+
for (const v of message.asset_refs) {
|
|
669
|
+
writer.uint32(42).string(v);
|
|
670
|
+
}
|
|
671
|
+
if (message._unknownFields !== undefined) {
|
|
672
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
673
|
+
const tag = parseInt(key, 10);
|
|
674
|
+
for (const value of values) {
|
|
675
|
+
writer.uint32(tag).raw(value);
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
return writer;
|
|
680
|
+
},
|
|
681
|
+
decode(input, length) {
|
|
682
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
683
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
684
|
+
const message = createBaseSpatialObjectV1();
|
|
685
|
+
while (reader.pos < end) {
|
|
686
|
+
const tag = reader.uint32();
|
|
687
|
+
switch (tag >>> 3) {
|
|
688
|
+
case 1: {
|
|
689
|
+
if (tag !== 10) {
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
message.spatial_id = reader.string();
|
|
693
|
+
continue;
|
|
694
|
+
}
|
|
695
|
+
case 2: {
|
|
696
|
+
if (tag !== 18) {
|
|
697
|
+
break;
|
|
698
|
+
}
|
|
699
|
+
message.parent_spatial_id = reader.string();
|
|
700
|
+
continue;
|
|
701
|
+
}
|
|
702
|
+
case 3: {
|
|
703
|
+
if (tag !== 26) {
|
|
704
|
+
break;
|
|
705
|
+
}
|
|
706
|
+
message.label = reader.string();
|
|
707
|
+
continue;
|
|
708
|
+
}
|
|
709
|
+
case 4: {
|
|
710
|
+
if (tag !== 34) {
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
message.author_settings = reader.bytes();
|
|
714
|
+
continue;
|
|
715
|
+
}
|
|
716
|
+
case 5: {
|
|
717
|
+
if (tag !== 42) {
|
|
718
|
+
break;
|
|
719
|
+
}
|
|
720
|
+
message.asset_refs.push(reader.string());
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
725
|
+
break;
|
|
726
|
+
}
|
|
727
|
+
const buf = reader.skip(tag & 7);
|
|
728
|
+
const list = message._unknownFields[tag];
|
|
729
|
+
if (list === undefined) {
|
|
730
|
+
message._unknownFields[tag] = [buf];
|
|
731
|
+
}
|
|
732
|
+
else {
|
|
733
|
+
list.push(buf);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
return message;
|
|
737
|
+
},
|
|
738
|
+
fromJSON(object) {
|
|
739
|
+
return {
|
|
740
|
+
spatial_id: isSet(object.spatialId)
|
|
741
|
+
? globalThis.String(object.spatialId)
|
|
742
|
+
: isSet(object.spatial_id)
|
|
743
|
+
? globalThis.String(object.spatial_id)
|
|
744
|
+
: "",
|
|
745
|
+
parent_spatial_id: isSet(object.parentSpatialId)
|
|
746
|
+
? globalThis.String(object.parentSpatialId)
|
|
747
|
+
: isSet(object.parent_spatial_id)
|
|
748
|
+
? globalThis.String(object.parent_spatial_id)
|
|
749
|
+
: "",
|
|
750
|
+
label: isSet(object.label) ? globalThis.String(object.label) : "",
|
|
751
|
+
author_settings: isSet(object.authorSettings)
|
|
752
|
+
? bytesFromBase64(object.authorSettings)
|
|
753
|
+
: isSet(object.author_settings)
|
|
754
|
+
? bytesFromBase64(object.author_settings)
|
|
755
|
+
: new Uint8Array(0),
|
|
756
|
+
asset_refs: globalThis.Array.isArray(object?.assetRefs)
|
|
757
|
+
? object.assetRefs.map((e) => globalThis.String(e))
|
|
758
|
+
: globalThis.Array.isArray(object?.asset_refs)
|
|
759
|
+
? object.asset_refs.map((e) => globalThis.String(e))
|
|
760
|
+
: [],
|
|
761
|
+
};
|
|
762
|
+
},
|
|
763
|
+
toJSON(message) {
|
|
764
|
+
const obj = {};
|
|
765
|
+
if (message.spatial_id !== "") {
|
|
766
|
+
obj.spatialId = message.spatial_id;
|
|
767
|
+
}
|
|
768
|
+
if (message.parent_spatial_id !== "") {
|
|
769
|
+
obj.parentSpatialId = message.parent_spatial_id;
|
|
770
|
+
}
|
|
771
|
+
if (message.label !== "") {
|
|
772
|
+
obj.label = message.label;
|
|
773
|
+
}
|
|
774
|
+
if (message.author_settings.length !== 0) {
|
|
775
|
+
obj.authorSettings = base64FromBytes(message.author_settings);
|
|
776
|
+
}
|
|
777
|
+
if (message.asset_refs?.length) {
|
|
778
|
+
obj.assetRefs = message.asset_refs;
|
|
779
|
+
}
|
|
780
|
+
return obj;
|
|
781
|
+
},
|
|
782
|
+
create(base) {
|
|
783
|
+
return SpatialObjectV1.fromPartial(base ?? {});
|
|
784
|
+
},
|
|
785
|
+
fromPartial(object) {
|
|
786
|
+
const message = createBaseSpatialObjectV1();
|
|
787
|
+
message.spatial_id = object.spatial_id ?? "";
|
|
788
|
+
message.parent_spatial_id = object.parent_spatial_id ?? "";
|
|
789
|
+
message.label = object.label ?? "";
|
|
790
|
+
message.author_settings = object.author_settings ?? new Uint8Array(0);
|
|
791
|
+
message.asset_refs = object.asset_refs?.map((e) => e) || [];
|
|
792
|
+
return message;
|
|
793
|
+
},
|
|
794
|
+
};
|
|
795
|
+
function createBaseSpatialPresetV1() {
|
|
796
|
+
return { preset_id: "", author_settings: new Uint8Array(0), _unknownFields: {} };
|
|
797
|
+
}
|
|
798
|
+
export const SpatialPresetV1 = {
|
|
799
|
+
encode(message, writer = new BinaryWriter()) {
|
|
800
|
+
if (message.preset_id !== "") {
|
|
801
|
+
writer.uint32(10).string(message.preset_id);
|
|
802
|
+
}
|
|
803
|
+
if (message.author_settings.length !== 0) {
|
|
804
|
+
writer.uint32(18).bytes(message.author_settings);
|
|
805
|
+
}
|
|
806
|
+
if (message._unknownFields !== undefined) {
|
|
807
|
+
for (const [key, values] of globalThis.Object.entries(message._unknownFields)) {
|
|
808
|
+
const tag = parseInt(key, 10);
|
|
809
|
+
for (const value of values) {
|
|
810
|
+
writer.uint32(tag).raw(value);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
return writer;
|
|
815
|
+
},
|
|
816
|
+
decode(input, length) {
|
|
817
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
818
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
819
|
+
const message = createBaseSpatialPresetV1();
|
|
820
|
+
while (reader.pos < end) {
|
|
821
|
+
const tag = reader.uint32();
|
|
822
|
+
switch (tag >>> 3) {
|
|
823
|
+
case 1: {
|
|
824
|
+
if (tag !== 10) {
|
|
825
|
+
break;
|
|
826
|
+
}
|
|
827
|
+
message.preset_id = reader.string();
|
|
828
|
+
continue;
|
|
829
|
+
}
|
|
830
|
+
case 2: {
|
|
831
|
+
if (tag !== 18) {
|
|
832
|
+
break;
|
|
833
|
+
}
|
|
834
|
+
message.author_settings = reader.bytes();
|
|
835
|
+
continue;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
839
|
+
break;
|
|
840
|
+
}
|
|
841
|
+
const buf = reader.skip(tag & 7);
|
|
842
|
+
const list = message._unknownFields[tag];
|
|
843
|
+
if (list === undefined) {
|
|
844
|
+
message._unknownFields[tag] = [buf];
|
|
845
|
+
}
|
|
846
|
+
else {
|
|
847
|
+
list.push(buf);
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
return message;
|
|
851
|
+
},
|
|
852
|
+
fromJSON(object) {
|
|
853
|
+
return {
|
|
854
|
+
preset_id: isSet(object.presetId)
|
|
855
|
+
? globalThis.String(object.presetId)
|
|
856
|
+
: isSet(object.preset_id)
|
|
857
|
+
? globalThis.String(object.preset_id)
|
|
858
|
+
: "",
|
|
859
|
+
author_settings: isSet(object.authorSettings)
|
|
860
|
+
? bytesFromBase64(object.authorSettings)
|
|
861
|
+
: isSet(object.author_settings)
|
|
862
|
+
? bytesFromBase64(object.author_settings)
|
|
863
|
+
: new Uint8Array(0),
|
|
864
|
+
};
|
|
865
|
+
},
|
|
866
|
+
toJSON(message) {
|
|
867
|
+
const obj = {};
|
|
868
|
+
if (message.preset_id !== "") {
|
|
869
|
+
obj.presetId = message.preset_id;
|
|
870
|
+
}
|
|
871
|
+
if (message.author_settings.length !== 0) {
|
|
872
|
+
obj.authorSettings = base64FromBytes(message.author_settings);
|
|
873
|
+
}
|
|
874
|
+
return obj;
|
|
875
|
+
},
|
|
876
|
+
create(base) {
|
|
877
|
+
return SpatialPresetV1.fromPartial(base ?? {});
|
|
878
|
+
},
|
|
879
|
+
fromPartial(object) {
|
|
880
|
+
const message = createBaseSpatialPresetV1();
|
|
881
|
+
message.preset_id = object.preset_id ?? "";
|
|
882
|
+
message.author_settings = object.author_settings ?? new Uint8Array(0);
|
|
883
|
+
return message;
|
|
884
|
+
},
|
|
885
|
+
};
|
|
886
|
+
function bytesFromBase64(b64) {
|
|
887
|
+
if (globalThis.Buffer) {
|
|
888
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
889
|
+
}
|
|
890
|
+
else {
|
|
891
|
+
const bin = globalThis.atob(b64);
|
|
892
|
+
const arr = new Uint8Array(bin.length);
|
|
893
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
894
|
+
arr[i] = bin.charCodeAt(i);
|
|
895
|
+
}
|
|
896
|
+
return arr;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
function base64FromBytes(arr) {
|
|
900
|
+
if (globalThis.Buffer) {
|
|
901
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
902
|
+
}
|
|
903
|
+
else {
|
|
904
|
+
const bin = [];
|
|
905
|
+
arr.forEach((byte) => {
|
|
906
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
907
|
+
});
|
|
908
|
+
return globalThis.btoa(bin.join(""));
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
function isSet(value) {
|
|
912
|
+
return value !== null && value !== undefined;
|
|
913
|
+
}
|