@etothepii/satisfactory-file-parser 0.4.6 → 0.4.8
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/README.md +1 -1
- package/build/parser/satisfactory/objects/DataFields.js +91 -4
- package/build/parser/satisfactory/objects/property/generic/ArrayProperty.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/BasicProperty.d.ts +8 -1
- package/build/parser/satisfactory/objects/property/generic/BasicProperty.js +5 -3
- package/build/parser/satisfactory/objects/property/generic/BoolProperty.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/ByteProperty.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/DoubleProperty.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/EnumProperty.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/FloatProperty.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/Int32Property.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/Int64Property.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/Int8Property.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/MapProperty.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/ObjectProperty.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/SetProperty.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/SoftObjectProperty.d.ts +12 -0
- package/build/parser/satisfactory/objects/property/generic/SoftObjectProperty.js +25 -0
- package/build/parser/satisfactory/objects/property/generic/StrProperty.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/TextProperty.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/Uint32Property.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/Uint64Property.js +1 -1
- package/build/parser/satisfactory/objects/property/generic/Uint8Property.js +1 -1
- package/build/parser/satisfactory/objects/property/special/SpecialAnyProperty.d.ts +30 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -14,12 +14,14 @@ const Int8Property_1 = require("./property/generic/Int8Property");
|
|
|
14
14
|
const MapProperty_1 = require("./property/generic/MapProperty");
|
|
15
15
|
const ObjectProperty_1 = require("./property/generic/ObjectProperty");
|
|
16
16
|
const SetProperty_1 = require("./property/generic/SetProperty");
|
|
17
|
+
const SoftObjectProperty_1 = require("./property/generic/SoftObjectProperty");
|
|
17
18
|
const StrProperty_1 = require("./property/generic/StrProperty");
|
|
18
19
|
const StructProperty_1 = require("./property/generic/StructProperty");
|
|
19
20
|
const TextProperty_1 = require("./property/generic/TextProperty");
|
|
20
21
|
const Uint32Property_1 = require("./property/generic/Uint32Property");
|
|
21
22
|
const Uint64Property_1 = require("./property/generic/Uint64Property");
|
|
22
23
|
const Uint8Property_1 = require("./property/generic/Uint8Property");
|
|
24
|
+
const ObjectReference_1 = require("./values/ObjectReference");
|
|
23
25
|
class DataFields {
|
|
24
26
|
constructor() {
|
|
25
27
|
}
|
|
@@ -73,9 +75,52 @@ class DataFields {
|
|
|
73
75
|
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk4/Build_ConveyorLiftMk4.Build_ConveyorLiftMk4_C':
|
|
74
76
|
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk5/Build_ConveyorLiftMk5.Build_ConveyorLiftMk5_C':
|
|
75
77
|
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk6/Build_ConveyorLiftMk6.Build_ConveyorLiftMk6_C':
|
|
76
|
-
|
|
78
|
+
reader.readInt32();
|
|
79
|
+
property = {};
|
|
80
|
+
break;
|
|
81
|
+
case '/Script/FactoryGame.FGConveyorChainActor':
|
|
82
|
+
const lastBelt = ObjectReference_1.ObjectReference.read(reader);
|
|
83
|
+
const firstBelt = ObjectReference_1.ObjectReference.read(reader);
|
|
84
|
+
const countBeltsInChain = reader.readInt32();
|
|
85
|
+
const beltsInChain = [];
|
|
86
|
+
for (let i = 0; i < countBeltsInChain; i++) {
|
|
87
|
+
const chainActorRef = ObjectReference_1.ObjectReference.read(reader);
|
|
88
|
+
const beltRef = ObjectReference_1.ObjectReference.read(reader);
|
|
89
|
+
const someCount = reader.readInt32();
|
|
90
|
+
const unknownUseBytes = Array.from(reader.readBytes(someCount * 3 * 24 + 12));
|
|
91
|
+
const firstItemIndex = reader.readInt32();
|
|
92
|
+
const lastItemIndex = reader.readInt32();
|
|
93
|
+
const beltIndexInChain = reader.readInt32();
|
|
94
|
+
beltsInChain.push({
|
|
95
|
+
chainActorRef,
|
|
96
|
+
beltRef,
|
|
97
|
+
someCount,
|
|
98
|
+
unknownUseBytes,
|
|
99
|
+
firstItemIndex,
|
|
100
|
+
lastItemIndex,
|
|
101
|
+
beltIndexInChain
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const unknownInts = [reader.readInt32(), reader.readInt32()];
|
|
105
|
+
const firstChainItemIndex = reader.readInt32();
|
|
106
|
+
const lastChainItemIndex = reader.readInt32();
|
|
107
|
+
const countItemsInChain = reader.readInt32();
|
|
108
|
+
const items = [];
|
|
109
|
+
for (let n = 0; n < countItemsInChain; n++) {
|
|
110
|
+
reader.readInt32();
|
|
111
|
+
const itemName = reader.readString();
|
|
112
|
+
reader.readInt32();
|
|
113
|
+
const position = reader.readInt32();
|
|
114
|
+
items.push({ itemName, position });
|
|
115
|
+
}
|
|
77
116
|
property = {
|
|
78
|
-
|
|
117
|
+
firstBelt: firstBelt,
|
|
118
|
+
lastBelt: lastBelt,
|
|
119
|
+
beltsInChain,
|
|
120
|
+
unknownInts,
|
|
121
|
+
firstChainItemIndex,
|
|
122
|
+
lastChainItemIndex,
|
|
123
|
+
items
|
|
79
124
|
};
|
|
80
125
|
break;
|
|
81
126
|
case '/Game/FactoryGame/Buildable/Factory/PowerLine/Build_PowerLine.Build_PowerLine_C':
|
|
@@ -116,7 +161,10 @@ class DataFields {
|
|
|
116
161
|
const transform = util_types_1.Transform.Parse(reader);
|
|
117
162
|
reader.readInt32();
|
|
118
163
|
const swatchSlotTypePath = reader.readString();
|
|
119
|
-
|
|
164
|
+
reader.readInt32();
|
|
165
|
+
reader.readInt64();
|
|
166
|
+
const patternPath = reader.readString();
|
|
167
|
+
const zeroes = util_types_1.vec2.Parse(reader);
|
|
120
168
|
const oneZeroOne = util_types_1.vec3.Parse(reader);
|
|
121
169
|
const unknownUseNumbers = [zeroes, oneZeroOne];
|
|
122
170
|
reader.readInt32();
|
|
@@ -131,6 +179,7 @@ class DataFields {
|
|
|
131
179
|
swatchSlotTypePath,
|
|
132
180
|
paintFinishPath,
|
|
133
181
|
recipeTypePath,
|
|
182
|
+
patternPath,
|
|
134
183
|
});
|
|
135
184
|
}
|
|
136
185
|
property.buildables.push({
|
|
@@ -205,6 +254,10 @@ class DataFields {
|
|
|
205
254
|
currentProperty = ObjectProperty_1.ObjectProperty.Parse(reader, propertyType, index);
|
|
206
255
|
overhead = ObjectProperty_1.ObjectProperty.CalcOverhead(currentProperty);
|
|
207
256
|
break;
|
|
257
|
+
case 'SoftObjectProperty':
|
|
258
|
+
currentProperty = SoftObjectProperty_1.SoftObjectProperty.Parse(reader, propertyType, index);
|
|
259
|
+
overhead = SoftObjectProperty_1.SoftObjectProperty.CalcOverhead(currentProperty);
|
|
260
|
+
break;
|
|
208
261
|
case 'EnumProperty':
|
|
209
262
|
currentProperty = EnumProperty_1.EnumProperty.Parse(reader, propertyType, index);
|
|
210
263
|
overhead = EnumProperty_1.EnumProperty.CalcOverhead(currentProperty);
|
|
@@ -257,12 +310,39 @@ class DataFields {
|
|
|
257
310
|
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk3/Build_ConveyorBeltMk3.Build_ConveyorBeltMk3_C':
|
|
258
311
|
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk4/Build_ConveyorBeltMk4.Build_ConveyorBeltMk4_C':
|
|
259
312
|
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk5/Build_ConveyorBeltMk5.Build_ConveyorBeltMk5_C':
|
|
313
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorBeltMk6/Build_ConveyorBeltMk6.Build_ConveyorBeltMk6_C':
|
|
260
314
|
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk1/Build_ConveyorLiftMk1.Build_ConveyorLiftMk1_C':
|
|
261
315
|
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk2/Build_ConveyorLiftMk2.Build_ConveyorLiftMk2_C':
|
|
262
316
|
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk3/Build_ConveyorLiftMk3.Build_ConveyorLiftMk3_C':
|
|
263
317
|
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk4/Build_ConveyorLiftMk4.Build_ConveyorLiftMk4_C':
|
|
264
318
|
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk5/Build_ConveyorLiftMk5.Build_ConveyorLiftMk5_C':
|
|
319
|
+
case '/Game/FactoryGame/Buildable/Factory/ConveyorLiftMk6/Build_ConveyorLiftMk6.Build_ConveyorLiftMk6_C':
|
|
320
|
+
writer.writeInt32(0);
|
|
321
|
+
break;
|
|
322
|
+
case '/Script/FactoryGame.FGConveyorChainActor':
|
|
323
|
+
ObjectReference_1.ObjectReference.write(writer, property.lastBelt);
|
|
324
|
+
ObjectReference_1.ObjectReference.write(writer, property.firstBelt);
|
|
325
|
+
writer.writeInt32(property.beltsInChain.length);
|
|
326
|
+
for (const belt of property.beltsInChain) {
|
|
327
|
+
ObjectReference_1.ObjectReference.write(writer, belt.chainActorRef);
|
|
328
|
+
ObjectReference_1.ObjectReference.write(writer, belt.beltRef);
|
|
329
|
+
writer.writeInt32(belt.someCount);
|
|
330
|
+
writer.writeBytesArray(belt.unknownUseBytes);
|
|
331
|
+
writer.writeInt32(belt.firstItemIndex);
|
|
332
|
+
writer.writeInt32(belt.lastItemIndex);
|
|
333
|
+
writer.writeInt32(belt.beltIndexInChain);
|
|
334
|
+
}
|
|
335
|
+
writer.writeInt32(property.unknownInts[0]);
|
|
336
|
+
writer.writeInt32(property.unknownInts[1]);
|
|
337
|
+
writer.writeInt32(property.firstChainItemIndex);
|
|
338
|
+
writer.writeInt32(property.lastChainItemIndex);
|
|
265
339
|
writer.writeInt32(property.items.length);
|
|
340
|
+
for (const item of property.items) {
|
|
341
|
+
writer.writeInt32(0);
|
|
342
|
+
writer.writeString(item.itemName);
|
|
343
|
+
writer.writeInt32(0);
|
|
344
|
+
writer.writeInt32(item.position);
|
|
345
|
+
}
|
|
266
346
|
break;
|
|
267
347
|
case '/Game/FactoryGame/Buildable/Factory/PowerLine/Build_PowerLine.Build_PowerLine_C':
|
|
268
348
|
case '/Game/FactoryGame/Events/Christmas/Buildings/PowerLineLights/Build_XmassLightsLine.Build_XmassLightsLine_C':
|
|
@@ -293,7 +373,10 @@ class DataFields {
|
|
|
293
373
|
util_types_1.Transform.Serialize(writer, instance.transform);
|
|
294
374
|
writer.writeInt32(0);
|
|
295
375
|
writer.writeString(instance.swatchSlotTypePath);
|
|
296
|
-
|
|
376
|
+
writer.writeInt32(0);
|
|
377
|
+
writer.writeInt64(0n);
|
|
378
|
+
writer.writeString(instance.patternPath);
|
|
379
|
+
util_types_1.vec2.Serialize(writer, instance.unknownUseNumbers[0]);
|
|
297
380
|
util_types_1.vec3.Serialize(writer, instance.unknownUseNumbers[1]);
|
|
298
381
|
writer.writeInt32(0);
|
|
299
382
|
writer.writeString(instance.paintFinishPath);
|
|
@@ -367,6 +450,10 @@ class DataFields {
|
|
|
367
450
|
overhead = ObjectProperty_1.ObjectProperty.CalcOverhead(property);
|
|
368
451
|
ObjectProperty_1.ObjectProperty.Serialize(writer, property);
|
|
369
452
|
break;
|
|
453
|
+
case 'SoftObjectProperty':
|
|
454
|
+
overhead = SoftObjectProperty_1.SoftObjectProperty.CalcOverhead(property);
|
|
455
|
+
SoftObjectProperty_1.SoftObjectProperty.Serialize(writer, property);
|
|
456
|
+
break;
|
|
370
457
|
case 'EnumProperty':
|
|
371
458
|
overhead = EnumProperty_1.EnumProperty.CalcOverhead(property);
|
|
372
459
|
EnumProperty_1.EnumProperty.Serialize(writer, property);
|
|
@@ -16,7 +16,7 @@ const StructProperty_1 = require("./StructProperty");
|
|
|
16
16
|
const TextProperty_1 = require("./TextProperty");
|
|
17
17
|
class ArrayProperty extends BasicProperty_1.BasicProperty {
|
|
18
18
|
constructor(subtype, values, ueType = 'ArrayProperty', index = 0, structValueFields) {
|
|
19
|
-
super('ArrayProperty', ueType,
|
|
19
|
+
super({ type: 'ArrayProperty', ueType, index });
|
|
20
20
|
this.subtype = subtype;
|
|
21
21
|
this.values = values;
|
|
22
22
|
this.structValueFields = structValueFields;
|
|
@@ -12,7 +12,14 @@ export declare abstract class AbstractBaseProperty extends AbstractProperty {
|
|
|
12
12
|
name: string;
|
|
13
13
|
constructor(type: string, ueType: string, index: number);
|
|
14
14
|
}
|
|
15
|
+
type AbstractBasePropertyOptions = {
|
|
16
|
+
type: string;
|
|
17
|
+
ueType: string;
|
|
18
|
+
guidInfo?: GUIDInfo;
|
|
19
|
+
index: number;
|
|
20
|
+
};
|
|
15
21
|
export declare abstract class BasicProperty extends AbstractBaseProperty {
|
|
16
22
|
guidInfo: GUIDInfo;
|
|
17
|
-
constructor(
|
|
23
|
+
constructor(options: AbstractBasePropertyOptions);
|
|
18
24
|
}
|
|
25
|
+
export {};
|
|
@@ -17,9 +17,11 @@ class AbstractBaseProperty extends AbstractProperty {
|
|
|
17
17
|
}
|
|
18
18
|
exports.AbstractBaseProperty = AbstractBaseProperty;
|
|
19
19
|
class BasicProperty extends AbstractBaseProperty {
|
|
20
|
-
constructor(
|
|
21
|
-
super(type, ueType, index);
|
|
22
|
-
|
|
20
|
+
constructor(options) {
|
|
21
|
+
super(options.type, options.ueType, options.index ?? 0);
|
|
22
|
+
if (options.guidInfo !== undefined) {
|
|
23
|
+
this.guidInfo = options.guidInfo;
|
|
24
|
+
}
|
|
23
25
|
}
|
|
24
26
|
}
|
|
25
27
|
exports.BasicProperty = BasicProperty;
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class BoolProperty extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'BoolProperty', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('BoolProperty', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'BoolProperty', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class ByteProperty extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'ByteProperty', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('ByteProperty', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'ByteProperty', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class DoubleProperty extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'DoubleProperty', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('DoubleProperty', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'DoubleProperty', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class EnumProperty extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'EnumProperty', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('EnumProperty', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'EnumProperty', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class FloatProperty extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'FloatProperty', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('FloatProperty', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'FloatProperty', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class Int32Property extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'IntProperty', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('Int32Property', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'Int32Property', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class Int64Property extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'Int64Property', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('Int64Property', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'Int64Property', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class Int8Property extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'Int8Property', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('Int8Property', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'Int8Property', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -11,7 +11,7 @@ const StrProperty_1 = require("./StrProperty");
|
|
|
11
11
|
const StructProperty_1 = require("./StructProperty");
|
|
12
12
|
class MapProperty extends BasicProperty_1.BasicProperty {
|
|
13
13
|
constructor(keyType, valueType, ueType, index) {
|
|
14
|
-
super('MapProperty', ueType,
|
|
14
|
+
super({ type: 'MapProperty', ueType, index });
|
|
15
15
|
this.keyType = keyType;
|
|
16
16
|
this.valueType = valueType;
|
|
17
17
|
this.modeType = 0;
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class ObjectProperty extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'ObjectProperty', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('ObjectProperty', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'ObjectProperty', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -10,7 +10,7 @@ const StrProperty_1 = require("./StrProperty");
|
|
|
10
10
|
const Uint32Property_1 = require("./Uint32Property");
|
|
11
11
|
class SetProperty extends BasicProperty_1.BasicProperty {
|
|
12
12
|
constructor(subtype, values, ueType, index) {
|
|
13
|
-
super('SetProperty', ueType,
|
|
13
|
+
super({ type: 'SetProperty', ueType, index });
|
|
14
14
|
this.subtype = subtype;
|
|
15
15
|
this.values = values;
|
|
16
16
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BinaryReadable } from '../../../../byte/binary-readable.interface';
|
|
2
|
+
import { ByteWriter } from '../../../../byte/byte-writer.class';
|
|
3
|
+
import { GUIDInfo } from '../../GUIDInfo';
|
|
4
|
+
import { SoftObjectReference } from '../../values/SoftObjectReference';
|
|
5
|
+
import { BasicProperty } from './BasicProperty';
|
|
6
|
+
export declare class SoftObjectProperty extends BasicProperty {
|
|
7
|
+
value: SoftObjectReference;
|
|
8
|
+
constructor(value: SoftObjectReference, ueType?: string, guidInfo?: GUIDInfo, index?: number);
|
|
9
|
+
static Parse(reader: BinaryReadable, ueType: string, index?: number): SoftObjectProperty;
|
|
10
|
+
static CalcOverhead(property: SoftObjectProperty): number;
|
|
11
|
+
static Serialize(writer: ByteWriter, property: SoftObjectProperty): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SoftObjectProperty = void 0;
|
|
4
|
+
const GUIDInfo_1 = require("../../GUIDInfo");
|
|
5
|
+
const SoftObjectReference_1 = require("../../values/SoftObjectReference");
|
|
6
|
+
const BasicProperty_1 = require("./BasicProperty");
|
|
7
|
+
class SoftObjectProperty extends BasicProperty_1.BasicProperty {
|
|
8
|
+
constructor(value, ueType = 'SoftObjectProperty', guidInfo = undefined, index = 0) {
|
|
9
|
+
super({ type: 'SoftObjectProperty', ueType, guidInfo, index });
|
|
10
|
+
this.value = value;
|
|
11
|
+
}
|
|
12
|
+
static Parse(reader, ueType, index = 0) {
|
|
13
|
+
const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
|
|
14
|
+
const value = SoftObjectReference_1.SoftObjectReference.read(reader);
|
|
15
|
+
return new SoftObjectProperty(value, ueType, guidInfo, index);
|
|
16
|
+
}
|
|
17
|
+
static CalcOverhead(property) {
|
|
18
|
+
return 1;
|
|
19
|
+
}
|
|
20
|
+
static Serialize(writer, property) {
|
|
21
|
+
GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
|
|
22
|
+
SoftObjectReference_1.SoftObjectReference.write(writer, property.value);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.SoftObjectProperty = SoftObjectProperty;
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class StrProperty extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'StrProperty', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('StrProperty', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'StrProperty', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class TextProperty extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'TextProperty', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('TextProperty', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'TextProperty', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class Uint32Property extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'UInt32Property', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('UInt32Property', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'UInt32Property', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class UInt64Property extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'UInt64Property', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('UInt64Property', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'UInt64Property', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -5,7 +5,7 @@ const GUIDInfo_1 = require("../../GUIDInfo");
|
|
|
5
5
|
const BasicProperty_1 = require("./BasicProperty");
|
|
6
6
|
class Uint8Property extends BasicProperty_1.BasicProperty {
|
|
7
7
|
constructor(value, ueType = 'UInt8Property', guidInfo = undefined, index = 0) {
|
|
8
|
-
super('UInt8Property', ueType, guidInfo, index);
|
|
8
|
+
super({ type: 'UInt8Property', ueType, guidInfo, index });
|
|
9
9
|
this.value = value;
|
|
10
10
|
}
|
|
11
11
|
static Parse(reader, ueType, index = 0) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Transform,
|
|
1
|
+
import { Transform, vec2, vec3 } from '../../../structs/util.types';
|
|
2
2
|
import { ObjectReference } from '../../values/ObjectReference';
|
|
3
|
-
export type SpecialAnyProperty = {} | PowerLineSpecialProperty | PlayerSpecialProperty |
|
|
3
|
+
export type SpecialAnyProperty = {} | PowerLineSpecialProperty | PlayerSpecialProperty | ConveyorChainActorSpecialProperty | BuildableSubsystemSpecialProperty;
|
|
4
4
|
export type PowerLineSpecialProperty = {
|
|
5
5
|
num: number;
|
|
6
6
|
source: ObjectReference;
|
|
@@ -13,24 +13,39 @@ export type PlayerSpecialProperty = {
|
|
|
13
13
|
eosData?: string;
|
|
14
14
|
steamPlayerData?: string;
|
|
15
15
|
};
|
|
16
|
-
export type
|
|
17
|
-
length: number;
|
|
18
|
-
name: string;
|
|
16
|
+
export type ConveyorItemSpecialProperty = {
|
|
19
17
|
position: number;
|
|
20
|
-
|
|
18
|
+
itemName: string;
|
|
21
19
|
};
|
|
22
|
-
export type
|
|
23
|
-
|
|
20
|
+
export type ConveyorChainSegmentSpecialProperty = {
|
|
21
|
+
chainActorRef: ObjectReference;
|
|
22
|
+
beltRef: ObjectReference;
|
|
23
|
+
someCount: number;
|
|
24
|
+
unknownUseBytes: number[];
|
|
25
|
+
firstItemIndex: number;
|
|
26
|
+
lastItemIndex: number;
|
|
27
|
+
beltIndexInChain: number;
|
|
28
|
+
};
|
|
29
|
+
export type ConveyorChainActorSpecialProperty = {
|
|
30
|
+
firstBelt: ObjectReference;
|
|
31
|
+
lastBelt: ObjectReference;
|
|
32
|
+
beltsInChain: ConveyorChainSegmentSpecialProperty[];
|
|
33
|
+
unknownInts: [number, number];
|
|
34
|
+
firstChainItemIndex: number;
|
|
35
|
+
lastChainItemIndex: number;
|
|
36
|
+
items: ConveyorItemSpecialProperty[];
|
|
37
|
+
};
|
|
38
|
+
export type BuildableTypeInstance = {
|
|
39
|
+
transform: Transform;
|
|
40
|
+
unknownUseNumbers: [vec2, vec3];
|
|
41
|
+
swatchSlotTypePath: string;
|
|
42
|
+
paintFinishPath: string;
|
|
43
|
+
recipeTypePath: string;
|
|
44
|
+
patternPath: string;
|
|
24
45
|
};
|
|
25
46
|
export type BuildableSubsystemSpecialProperty = {
|
|
26
47
|
buildables: {
|
|
27
48
|
typePath: string;
|
|
28
|
-
instances:
|
|
29
|
-
transform: Transform;
|
|
30
|
-
unknownUseNumbers: [vec4, vec3];
|
|
31
|
-
swatchSlotTypePath: string;
|
|
32
|
-
paintFinishPath: string;
|
|
33
|
-
recipeTypePath: string;
|
|
34
|
-
}[];
|
|
49
|
+
instances: BuildableTypeInstance[];
|
|
35
50
|
}[];
|
|
36
51
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etothepii/satisfactory-file-parser",
|
|
3
3
|
"author": "etothepii",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.8",
|
|
5
5
|
"description": "A file parser for satisfactory files. Includes save files and blueprint files.",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
7
7
|
"main": "./build/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"typescript"
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
|
-
"test": "jest --config=jest.config.json --max_old_space_size=30720",
|
|
17
|
+
"test": "set PARSER_DEBUG=debug&& jest --config=jest.config.json --max_old_space_size=30720",
|
|
18
18
|
"build": "tsc && npm run bundle",
|
|
19
19
|
"bundle": "npx webpack && dts-bundle-generator -o dist/index.d.ts src/index.ts",
|
|
20
20
|
"prepublishOnly": "npm run build && npm version patch"
|