@etothepii/satisfactory-file-parser 0.4.20 → 0.4.22

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.
Files changed (86) hide show
  1. package/README.md +11 -4
  2. package/build/index.d.ts +35 -36
  3. package/build/index.js +36 -40
  4. package/build/parser/satisfactory/blueprint/blueprint-reader.d.ts +2 -2
  5. package/build/parser/satisfactory/blueprint/blueprint-reader.js +12 -10
  6. package/build/parser/satisfactory/blueprint/blueprint-writer.d.ts +2 -2
  7. package/build/parser/satisfactory/blueprint/blueprint-writer.js +6 -6
  8. package/build/parser/satisfactory/blueprint/blueprint.types.d.ts +6 -5
  9. package/build/parser/satisfactory/save/level.class.d.ts +6 -6
  10. package/build/parser/satisfactory/save/level.class.js +22 -22
  11. package/build/parser/satisfactory/save/save-reader.js +1 -1
  12. package/build/parser/satisfactory/save/save-writer.js +2 -2
  13. package/build/parser/satisfactory/save/save.types.d.ts +1 -1
  14. package/build/parser/satisfactory/types/objects/SaveComponent.d.ts +19 -0
  15. package/build/parser/satisfactory/types/objects/SaveComponent.js +31 -0
  16. package/build/parser/satisfactory/types/objects/SaveEntity.d.ts +30 -0
  17. package/build/parser/satisfactory/types/objects/SaveEntity.js +66 -0
  18. package/build/parser/satisfactory/types/objects/SaveObject.d.ts +24 -0
  19. package/build/parser/satisfactory/types/objects/SaveObject.js +33 -0
  20. package/build/parser/satisfactory/types/property/DataFields.d.ts +15 -0
  21. package/build/parser/satisfactory/types/property/DataFields.js +493 -0
  22. package/build/parser/satisfactory/types/property/generic/ArrayProperty.d.ts +22 -0
  23. package/build/parser/satisfactory/types/property/generic/ArrayProperty.js +171 -0
  24. package/build/parser/satisfactory/types/property/generic/BasicProperty.d.ts +25 -0
  25. package/build/parser/satisfactory/types/property/generic/BasicProperty.js +28 -0
  26. package/build/parser/satisfactory/types/property/generic/BoolProperty.d.ts +14 -0
  27. package/build/parser/satisfactory/types/property/generic/BoolProperty.js +32 -0
  28. package/build/parser/satisfactory/types/property/generic/ByteProperty.d.ts +18 -0
  29. package/build/parser/satisfactory/types/property/generic/ByteProperty.js +52 -0
  30. package/build/parser/satisfactory/types/property/generic/DoubleProperty.d.ts +14 -0
  31. package/build/parser/satisfactory/types/property/generic/DoubleProperty.js +32 -0
  32. package/build/parser/satisfactory/types/property/generic/EnumProperty.d.ts +20 -0
  33. package/build/parser/satisfactory/types/property/generic/EnumProperty.js +35 -0
  34. package/build/parser/satisfactory/types/property/generic/FloatProperty.d.ts +14 -0
  35. package/build/parser/satisfactory/types/property/generic/FloatProperty.js +32 -0
  36. package/build/parser/satisfactory/types/property/generic/Int32Property.d.ts +14 -0
  37. package/build/parser/satisfactory/types/property/generic/Int32Property.js +32 -0
  38. package/build/parser/satisfactory/types/property/generic/Int64Property.d.ts +14 -0
  39. package/build/parser/satisfactory/types/property/generic/Int64Property.js +32 -0
  40. package/build/parser/satisfactory/types/property/generic/Int8Property.d.ts +14 -0
  41. package/build/parser/satisfactory/types/property/generic/Int8Property.js +32 -0
  42. package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts +22 -0
  43. package/build/parser/satisfactory/types/property/generic/MapProperty.js +162 -0
  44. package/build/parser/satisfactory/types/property/generic/ObjectProperty.d.ts +15 -0
  45. package/build/parser/satisfactory/types/property/generic/ObjectProperty.js +37 -0
  46. package/build/parser/satisfactory/types/property/generic/SetProperty.d.ts +12 -0
  47. package/build/parser/satisfactory/types/property/generic/SetProperty.js +94 -0
  48. package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.d.ts +13 -0
  49. package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.js +27 -0
  50. package/build/parser/satisfactory/types/property/generic/StrProperty.d.ts +14 -0
  51. package/build/parser/satisfactory/types/property/generic/StrProperty.js +32 -0
  52. package/build/parser/satisfactory/types/property/generic/StructProperty.d.ts +69 -0
  53. package/build/parser/satisfactory/types/property/generic/StructProperty.js +365 -0
  54. package/build/parser/satisfactory/types/property/generic/TextProperty.d.ts +30 -0
  55. package/build/parser/satisfactory/types/property/generic/TextProperty.js +111 -0
  56. package/build/parser/satisfactory/types/property/generic/Uint32Property.d.ts +14 -0
  57. package/build/parser/satisfactory/types/property/generic/Uint32Property.js +32 -0
  58. package/build/parser/satisfactory/types/property/generic/Uint64Property.d.ts +14 -0
  59. package/build/parser/satisfactory/types/property/generic/Uint64Property.js +32 -0
  60. package/build/parser/satisfactory/types/property/generic/Uint8Property.d.ts +14 -0
  61. package/build/parser/satisfactory/types/property/generic/Uint8Property.js +32 -0
  62. package/build/parser/satisfactory/types/property/special/SpecialAnyProperty.d.ts +54 -0
  63. package/build/parser/satisfactory/types/property/special/SpecialAnyProperty.js +2 -0
  64. package/build/parser/satisfactory/types/structs/GUID.d.ts +7 -0
  65. package/build/parser/satisfactory/types/structs/GUID.js +21 -0
  66. package/build/parser/satisfactory/types/structs/GUIDInfo.d.ts +8 -0
  67. package/build/parser/satisfactory/types/structs/GUIDInfo.js +26 -0
  68. package/build/parser/satisfactory/types/structs/MD5Hash.d.ts +10 -0
  69. package/build/parser/satisfactory/types/structs/MD5Hash.js +21 -0
  70. package/build/parser/satisfactory/types/structs/ObjectReference.d.ts +10 -0
  71. package/build/parser/satisfactory/types/structs/ObjectReference.js +17 -0
  72. package/build/parser/satisfactory/types/structs/SoftObjectReference.d.ts +11 -0
  73. package/build/parser/satisfactory/types/structs/SoftObjectReference.js +19 -0
  74. package/build/parser/satisfactory/types/structs/Transform.d.ts +15 -0
  75. package/build/parser/satisfactory/types/structs/Transform.js +32 -0
  76. package/build/parser/satisfactory/types/structs/col4.d.ts +14 -0
  77. package/build/parser/satisfactory/types/structs/col4.js +34 -0
  78. package/build/parser/satisfactory/types/structs/vec2.d.ts +12 -0
  79. package/build/parser/satisfactory/types/structs/vec2.js +26 -0
  80. package/build/parser/satisfactory/types/structs/vec3.d.ts +19 -0
  81. package/build/parser/satisfactory/types/structs/vec3.js +44 -0
  82. package/build/parser/satisfactory/types/structs/vec4.d.ts +12 -0
  83. package/build/parser/satisfactory/types/structs/vec4.js +27 -0
  84. package/build/parser/stream/reworked/readable-stream-parser.js +3 -3
  85. package/build/parser/stream/reworked/save-stream-writer.class.d.ts +2 -2
  86. package/package.json +1 -1
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ArrayProperty = exports.isArrayProperty = void 0;
4
+ const SoftObjectReference_1 = require("../../structs/SoftObjectReference");
5
+ const BasicProperty_1 = require("./BasicProperty");
6
+ const BoolProperty_1 = require("./BoolProperty");
7
+ const ByteProperty_1 = require("./ByteProperty");
8
+ const DoubleProperty_1 = require("./DoubleProperty");
9
+ const EnumProperty_1 = require("./EnumProperty");
10
+ const FloatProperty_1 = require("./FloatProperty");
11
+ const Int32Property_1 = require("./Int32Property");
12
+ const Int64Property_1 = require("./Int64Property");
13
+ const ObjectProperty_1 = require("./ObjectProperty");
14
+ const StrProperty_1 = require("./StrProperty");
15
+ const StructProperty_1 = require("./StructProperty");
16
+ const TextProperty_1 = require("./TextProperty");
17
+ const isArrayProperty = (property) => property.type === 'ArrayProperty';
18
+ exports.isArrayProperty = isArrayProperty;
19
+ class ArrayProperty extends BasicProperty_1.BasicProperty {
20
+ constructor(subtype, values, ueType = 'ArrayProperty', index = 0, structValueFields) {
21
+ super({ type: 'ArrayProperty', ueType, index });
22
+ this.subtype = subtype;
23
+ this.values = values;
24
+ this.structValueFields = structValueFields;
25
+ }
26
+ static Parse(reader, ueType, index, propertyName) {
27
+ const subtype = reader.readString();
28
+ reader.skipBytes(1);
29
+ let property;
30
+ const elementCount = reader.readInt32();
31
+ switch (subtype) {
32
+ case "FloatProperty":
33
+ property = new ArrayProperty(subtype, new Array(elementCount).fill(0).map(() => FloatProperty_1.FloatProperty.ReadValue(reader)), ueType, index);
34
+ break;
35
+ case "BoolProperty":
36
+ property = new ArrayProperty(subtype, new Array(elementCount).fill(0).map(() => BoolProperty_1.BoolProperty.ReadValue(reader)), ueType, index);
37
+ break;
38
+ case "IntProperty":
39
+ property = new ArrayProperty(subtype, new Array(elementCount).fill(0).map(() => Int32Property_1.Int32Property.ReadValue(reader)), ueType, index);
40
+ break;
41
+ case "Int64Property":
42
+ property = new ArrayProperty(subtype, new Array(elementCount).fill(0).map(() => Int64Property_1.Int64Property.ReadValue(reader)), ueType, index);
43
+ break;
44
+ case "DoubleProperty":
45
+ property = new ArrayProperty(subtype, new Array(elementCount).fill(0).map(() => DoubleProperty_1.DoubleProperty.ReadValue(reader)), ueType, index);
46
+ break;
47
+ case "ByteProperty":
48
+ property = new ArrayProperty(subtype, new Array(elementCount).fill(0).map(() => ByteProperty_1.ByteProperty.ReadValue(reader)), ueType, index);
49
+ break;
50
+ case "StrProperty":
51
+ property = new ArrayProperty(subtype, new Array(elementCount).fill(0).map(() => StrProperty_1.StrProperty.ReadValue(reader)), ueType, index);
52
+ break;
53
+ case "EnumProperty":
54
+ property = new ArrayProperty(subtype, new Array(elementCount).fill(0).map(() => EnumProperty_1.EnumProperty.ReadValue(reader)), ueType, index);
55
+ break;
56
+ case "TextProperty":
57
+ property = new ArrayProperty(subtype, new Array(elementCount).fill(0).map(() => TextProperty_1.TextProperty.ParseValue(reader)), ueType, index);
58
+ break;
59
+ case "InterfaceProperty":
60
+ case "ObjectProperty":
61
+ property = new ArrayProperty(subtype, new Array(elementCount).fill(0).map(() => ObjectProperty_1.ObjectProperty.ReadValue(reader)), ueType, index);
62
+ break;
63
+ case "SoftObjectProperty":
64
+ property = new ArrayProperty(subtype, new Array(elementCount).fill(0).map(() => SoftObjectReference_1.SoftObjectReference.read(reader)), ueType, index);
65
+ break;
66
+ case "StructProperty":
67
+ const name = reader.readString();
68
+ const type = reader.readString();
69
+ const binarySize = reader.readInt32();
70
+ const allIndex = reader.readInt32();
71
+ const allStructType = reader.readString();
72
+ const allGuid = reader.readInt32();
73
+ const allUnk1 = reader.readInt32();
74
+ const allUnk2 = reader.readInt32();
75
+ const allUnk3 = reader.readInt32();
76
+ const allUnk4 = reader.readByte();
77
+ const innerStructValueFields = { allStructType, allIndex, allGuid };
78
+ if (allUnk1 !== 0) {
79
+ innerStructValueFields.allUnk1 = allUnk1;
80
+ }
81
+ if (allUnk2 !== 0) {
82
+ innerStructValueFields.allUnk2 = allUnk2;
83
+ }
84
+ if (allUnk3 !== 0) {
85
+ innerStructValueFields.allUnk3 = allUnk3;
86
+ }
87
+ if (allUnk4 !== 0) {
88
+ innerStructValueFields.allUnk4 = allUnk4;
89
+ }
90
+ const before = reader.getBufferPosition();
91
+ const maArr = new Array(elementCount).fill(0).map(() => {
92
+ const struct = new StructProperty_1.StructProperty(allStructType, type, allIndex, allGuid);
93
+ struct.value = StructProperty_1.StructProperty.ParseValue(reader, allStructType, binarySize);
94
+ return struct;
95
+ });
96
+ const readBytes = reader.getBufferPosition() - before;
97
+ if (readBytes !== binarySize) {
98
+ throw new Error('possibly corrupt in array of struct.');
99
+ }
100
+ property = new ArrayProperty(subtype, maArr, ueType, index, innerStructValueFields);
101
+ break;
102
+ default:
103
+ console.log(subtype, ueType);
104
+ throw new Error();
105
+ }
106
+ return property;
107
+ }
108
+ static CalcOverhead(property) {
109
+ return property.subtype.length + 5 + 1;
110
+ }
111
+ static Serialize(writer, property, propertyName) {
112
+ writer.writeString(property.subtype);
113
+ writer.writeByte(0);
114
+ writer.writeInt32(property.values.length);
115
+ switch (property.subtype) {
116
+ case "FloatProperty":
117
+ property.values.forEach(v => FloatProperty_1.FloatProperty.SerializeValue(writer, v));
118
+ break;
119
+ case "BoolProperty":
120
+ property.values.forEach(v => BoolProperty_1.BoolProperty.SerializeValue(writer, v));
121
+ break;
122
+ case "IntProperty":
123
+ property.values.forEach(v => Int32Property_1.Int32Property.SerializeValue(writer, v));
124
+ break;
125
+ case "Int64Property":
126
+ property.values.forEach(v => Int64Property_1.Int64Property.SerializeValue(writer, v));
127
+ break;
128
+ case "DoubleProperty":
129
+ property.values.forEach(v => DoubleProperty_1.DoubleProperty.SerializeValue(writer, v));
130
+ break;
131
+ case "ByteProperty":
132
+ property.values.forEach(v => ByteProperty_1.ByteProperty.SerializeValue(writer, v));
133
+ break;
134
+ case "StrProperty":
135
+ property.values.forEach(v => StrProperty_1.StrProperty.SerializeValue(writer, v));
136
+ break;
137
+ case "EnumProperty":
138
+ property.values.forEach(v => EnumProperty_1.EnumProperty.SerializeValue(writer, v));
139
+ break;
140
+ case "TextProperty":
141
+ property.values.forEach(v => TextProperty_1.TextProperty.SerializeValue(writer, v));
142
+ break;
143
+ case "InterfaceProperty":
144
+ case "ObjectProperty":
145
+ property.values.forEach(v => ObjectProperty_1.ObjectProperty.SerializeValue(writer, v));
146
+ break;
147
+ case "SoftObjectProperty":
148
+ property.values.forEach(v => SoftObjectReference_1.SoftObjectReference.write(writer, v));
149
+ break;
150
+ case "StructProperty":
151
+ writer.writeString(propertyName);
152
+ writer.writeString(property.subtype);
153
+ const lenIndicator = writer.getBufferPosition();
154
+ writer.writeInt32(0);
155
+ writer.writeInt32(property.structValueFields.allIndex);
156
+ writer.writeString(property.structValueFields.allStructType);
157
+ writer.writeInt32(property.structValueFields.allGuid);
158
+ writer.writeInt32(property.structValueFields.allUnk1 ?? 0);
159
+ writer.writeInt32(property.structValueFields.allUnk2 ?? 0);
160
+ writer.writeInt32(property.structValueFields.allUnk3 ?? 0);
161
+ writer.writeByte(property.structValueFields.allUnk4 ?? 0);
162
+ const before = writer.getBufferPosition();
163
+ property.values.forEach(v => StructProperty_1.StructProperty.SerializeValue(writer, property.structValueFields.allStructType, v.value));
164
+ writer.writeBinarySizeFromPosition(lenIndicator, before);
165
+ break;
166
+ default:
167
+ throw new Error(`Unknown array property ${property.ueType}, ${property.type}`);
168
+ }
169
+ }
170
+ }
171
+ exports.ArrayProperty = ArrayProperty;
@@ -0,0 +1,25 @@
1
+ import { GUIDInfo } from '../../structs/GUIDInfo';
2
+ export type PropertiesMap = {
3
+ [name: string]: AbstractBaseProperty | AbstractBaseProperty[];
4
+ };
5
+ export declare abstract class AbstractProperty {
6
+ type: string;
7
+ index?: number | undefined;
8
+ constructor(type: string, index?: number | undefined);
9
+ }
10
+ export declare abstract class AbstractBaseProperty extends AbstractProperty {
11
+ ueType: string;
12
+ name: string;
13
+ constructor(type: string, ueType: string, index: number);
14
+ }
15
+ type AbstractBasePropertyOptions = {
16
+ type: string;
17
+ ueType: string;
18
+ guidInfo?: GUIDInfo;
19
+ index: number;
20
+ };
21
+ export declare abstract class BasicProperty extends AbstractBaseProperty {
22
+ guidInfo: GUIDInfo;
23
+ constructor(options: AbstractBasePropertyOptions);
24
+ }
25
+ export {};
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BasicProperty = exports.AbstractBaseProperty = exports.AbstractProperty = void 0;
4
+ class AbstractProperty {
5
+ constructor(type, index) {
6
+ this.type = type;
7
+ this.index = index;
8
+ }
9
+ }
10
+ exports.AbstractProperty = AbstractProperty;
11
+ class AbstractBaseProperty extends AbstractProperty {
12
+ constructor(type, ueType, index) {
13
+ super(type, index && index !== 0 ? index : undefined);
14
+ this.ueType = ueType;
15
+ this.name = '';
16
+ }
17
+ }
18
+ exports.AbstractBaseProperty = AbstractBaseProperty;
19
+ class BasicProperty extends AbstractBaseProperty {
20
+ constructor(options) {
21
+ super(options.type, options.ueType, options.index ?? 0);
22
+ this.guidInfo = undefined;
23
+ if (options.guidInfo !== undefined) {
24
+ this.guidInfo = options.guidInfo;
25
+ }
26
+ }
27
+ }
28
+ exports.BasicProperty = BasicProperty;
@@ -0,0 +1,14 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { GUIDInfo } from '../../structs/GUIDInfo';
4
+ import { BasicProperty } from './BasicProperty';
5
+ export declare const isBoolProperty: (property: BasicProperty) => property is BoolProperty;
6
+ export declare class BoolProperty extends BasicProperty {
7
+ value: boolean;
8
+ constructor(value: boolean, ueType?: string, guidInfo?: GUIDInfo, index?: number);
9
+ static Parse(reader: BinaryReadable, ueType: string, index?: number): BoolProperty;
10
+ static ReadValue(reader: BinaryReadable): boolean;
11
+ static CalcOverhead(property: BoolProperty): number;
12
+ static Serialize(writer: ByteWriter, property: BoolProperty): void;
13
+ static SerializeValue(writer: ByteWriter, value: boolean): void;
14
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BoolProperty = exports.isBoolProperty = void 0;
4
+ const GUIDInfo_1 = require("../../structs/GUIDInfo");
5
+ const BasicProperty_1 = require("./BasicProperty");
6
+ const isBoolProperty = (property) => property.type === 'BoolProperty';
7
+ exports.isBoolProperty = isBoolProperty;
8
+ class BoolProperty extends BasicProperty_1.BasicProperty {
9
+ constructor(value, ueType = 'BoolProperty', guidInfo = undefined, index = 0) {
10
+ super({ type: 'BoolProperty', ueType, guidInfo, index });
11
+ this.value = value;
12
+ }
13
+ static Parse(reader, ueType, index = 0) {
14
+ const value = BoolProperty.ReadValue(reader);
15
+ const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
16
+ return new BoolProperty(value, ueType, guidInfo, index);
17
+ }
18
+ static ReadValue(reader) {
19
+ return reader.readByte() > 0;
20
+ }
21
+ static CalcOverhead(property) {
22
+ return 2;
23
+ }
24
+ static Serialize(writer, property) {
25
+ BoolProperty.SerializeValue(writer, property.value);
26
+ GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
27
+ }
28
+ static SerializeValue(writer, value) {
29
+ writer.writeByte(value ? 1 : 0);
30
+ }
31
+ }
32
+ exports.BoolProperty = BoolProperty;
@@ -0,0 +1,18 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { GUIDInfo } from '../../structs/GUIDInfo';
4
+ import { BasicProperty } from './BasicProperty';
5
+ export declare const isByteProperty: (property: BasicProperty) => property is ByteProperty;
6
+ export declare class ByteProperty extends BasicProperty {
7
+ value: BytePropertyValue;
8
+ constructor(value: BytePropertyValue, ueType?: string, guidInfo?: GUIDInfo, index?: number);
9
+ static Parse(reader: BinaryReadable, ueType: string, index?: number): ByteProperty;
10
+ static ReadValue(reader: BinaryReadable): number;
11
+ static CalcOverhead(property: ByteProperty): number;
12
+ static Serialize(writer: ByteWriter, property: ByteProperty): void;
13
+ static SerializeValue(writer: ByteWriter, value: number): void;
14
+ }
15
+ export type BytePropertyValue = {
16
+ type: string;
17
+ value: string | number;
18
+ };
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ByteProperty = exports.isByteProperty = void 0;
4
+ const GUIDInfo_1 = require("../../structs/GUIDInfo");
5
+ const BasicProperty_1 = require("./BasicProperty");
6
+ const isByteProperty = (property) => property.type === 'ByteProperty';
7
+ exports.isByteProperty = isByteProperty;
8
+ class ByteProperty extends BasicProperty_1.BasicProperty {
9
+ constructor(value, ueType = 'ByteProperty', guidInfo = undefined, index = 0) {
10
+ super({ type: 'ByteProperty', ueType, guidInfo, index });
11
+ this.value = value;
12
+ }
13
+ static Parse(reader, ueType, index = 0) {
14
+ const type = reader.readString();
15
+ const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
16
+ let value;
17
+ if (type === 'None') {
18
+ value = {
19
+ type,
20
+ value: ByteProperty.ReadValue(reader)
21
+ };
22
+ }
23
+ else {
24
+ value = {
25
+ type,
26
+ value: reader.readString()
27
+ };
28
+ }
29
+ const property = new ByteProperty(value, ueType, guidInfo, index);
30
+ return property;
31
+ }
32
+ static ReadValue(reader) {
33
+ return reader.readByte();
34
+ }
35
+ static CalcOverhead(property) {
36
+ return property.value.type.length + 5 + 1;
37
+ }
38
+ static Serialize(writer, property) {
39
+ writer.writeString(property.value.type);
40
+ GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
41
+ if (property.value.type === 'None') {
42
+ ByteProperty.SerializeValue(writer, property.value.value);
43
+ }
44
+ else {
45
+ writer.writeString(property.value.value);
46
+ }
47
+ }
48
+ static SerializeValue(writer, value) {
49
+ writer.writeByte(value);
50
+ }
51
+ }
52
+ exports.ByteProperty = ByteProperty;
@@ -0,0 +1,14 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { GUIDInfo } from '../../structs/GUIDInfo';
4
+ import { BasicProperty } from './BasicProperty';
5
+ export declare const isDoubleProperty: (property: BasicProperty) => property is DoubleProperty;
6
+ export declare class DoubleProperty extends BasicProperty {
7
+ value: number;
8
+ constructor(value: number, ueType?: string, guidInfo?: GUIDInfo, index?: number);
9
+ static Parse(reader: BinaryReadable, ueType: string, index?: number): DoubleProperty;
10
+ static ReadValue(reader: BinaryReadable): number;
11
+ static CalcOverhead(property: DoubleProperty): number;
12
+ static Serialize(writer: ByteWriter, property: DoubleProperty): void;
13
+ static SerializeValue(writer: ByteWriter, value: number): void;
14
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DoubleProperty = exports.isDoubleProperty = void 0;
4
+ const GUIDInfo_1 = require("../../structs/GUIDInfo");
5
+ const BasicProperty_1 = require("./BasicProperty");
6
+ const isDoubleProperty = (property) => property.type === 'DoubleProperty';
7
+ exports.isDoubleProperty = isDoubleProperty;
8
+ class DoubleProperty extends BasicProperty_1.BasicProperty {
9
+ constructor(value, ueType = 'DoubleProperty', guidInfo = undefined, index = 0) {
10
+ super({ type: 'DoubleProperty', ueType, guidInfo, index });
11
+ this.value = value;
12
+ }
13
+ static Parse(reader, ueType, index = 0) {
14
+ const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
15
+ const value = DoubleProperty.ReadValue(reader);
16
+ return new DoubleProperty(value, ueType, guidInfo, index);
17
+ }
18
+ static ReadValue(reader) {
19
+ return reader.readDouble();
20
+ }
21
+ static CalcOverhead(property) {
22
+ return 1;
23
+ }
24
+ static Serialize(writer, property) {
25
+ GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
26
+ DoubleProperty.SerializeValue(writer, property.value);
27
+ }
28
+ static SerializeValue(writer, value) {
29
+ writer.writeDouble(value);
30
+ }
31
+ }
32
+ exports.DoubleProperty = DoubleProperty;
@@ -0,0 +1,20 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { GUIDInfo } from '../../structs/GUIDInfo';
4
+ import { BasicProperty } from './BasicProperty';
5
+ export declare const isEnumProperty: (property: BasicProperty) => property is EnumProperty;
6
+ export declare class EnumProperty extends BasicProperty {
7
+ value: {
8
+ name: string;
9
+ value: string;
10
+ };
11
+ constructor(value: {
12
+ name: string;
13
+ value: string;
14
+ }, ueType?: string, guidInfo?: GUIDInfo, index?: number);
15
+ static Parse(reader: BinaryReadable, ueType: string, index?: number): EnumProperty;
16
+ static ReadValue(reader: BinaryReadable): string;
17
+ static CalcOverhead(property: EnumProperty): number;
18
+ static Serialize(writer: ByteWriter, property: EnumProperty): void;
19
+ static SerializeValue(writer: ByteWriter, value: string): void;
20
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EnumProperty = exports.isEnumProperty = void 0;
4
+ const GUIDInfo_1 = require("../../structs/GUIDInfo");
5
+ const BasicProperty_1 = require("./BasicProperty");
6
+ const isEnumProperty = (property) => property.type === 'EnumProperty';
7
+ exports.isEnumProperty = isEnumProperty;
8
+ class EnumProperty extends BasicProperty_1.BasicProperty {
9
+ constructor(value, ueType = 'EnumProperty', guidInfo = undefined, index = 0) {
10
+ super({ type: 'EnumProperty', ueType, guidInfo, index });
11
+ this.value = value;
12
+ }
13
+ static Parse(reader, ueType, index = 0) {
14
+ let name = reader.readString();
15
+ const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
16
+ const value = EnumProperty.ReadValue(reader);
17
+ const property = new EnumProperty({ name, value }, ueType, guidInfo, index);
18
+ return property;
19
+ }
20
+ static ReadValue(reader) {
21
+ return reader.readString();
22
+ }
23
+ static CalcOverhead(property) {
24
+ return property.value.name.length + 6;
25
+ }
26
+ static Serialize(writer, property) {
27
+ writer.writeString(property.value.name);
28
+ GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
29
+ EnumProperty.SerializeValue(writer, property.value.value);
30
+ }
31
+ static SerializeValue(writer, value) {
32
+ writer.writeString(value);
33
+ }
34
+ }
35
+ exports.EnumProperty = EnumProperty;
@@ -0,0 +1,14 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { GUIDInfo } from '../../structs/GUIDInfo';
4
+ import { BasicProperty } from './BasicProperty';
5
+ export declare const isFloatProperty: (property: BasicProperty) => property is FloatProperty;
6
+ export declare class FloatProperty extends BasicProperty {
7
+ value: number;
8
+ constructor(value: number, ueType?: string, guidInfo?: GUIDInfo, index?: number);
9
+ static Parse(reader: BinaryReadable, ueType: string, index?: number): FloatProperty;
10
+ static CalcOverhead(property: FloatProperty): number;
11
+ static ReadValue(reader: BinaryReadable): number;
12
+ static Serialize(writer: ByteWriter, property: FloatProperty): void;
13
+ static SerializeValue(writer: ByteWriter, value: number): void;
14
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FloatProperty = exports.isFloatProperty = void 0;
4
+ const GUIDInfo_1 = require("../../structs/GUIDInfo");
5
+ const BasicProperty_1 = require("./BasicProperty");
6
+ const isFloatProperty = (property) => property.type === 'FloatProperty';
7
+ exports.isFloatProperty = isFloatProperty;
8
+ class FloatProperty extends BasicProperty_1.BasicProperty {
9
+ constructor(value, ueType = 'FloatProperty', guidInfo = undefined, index = 0) {
10
+ super({ type: 'FloatProperty', ueType, guidInfo, index });
11
+ this.value = value;
12
+ }
13
+ static Parse(reader, ueType, index = 0) {
14
+ const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
15
+ const value = FloatProperty.ReadValue(reader);
16
+ return new FloatProperty(value, ueType, guidInfo, index);
17
+ }
18
+ static CalcOverhead(property) {
19
+ return 1;
20
+ }
21
+ static ReadValue(reader) {
22
+ return reader.readFloat32();
23
+ }
24
+ static Serialize(writer, property) {
25
+ GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
26
+ FloatProperty.SerializeValue(writer, property.value);
27
+ }
28
+ static SerializeValue(writer, value) {
29
+ writer.writeFloat32(value);
30
+ }
31
+ }
32
+ exports.FloatProperty = FloatProperty;
@@ -0,0 +1,14 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { GUIDInfo } from '../../structs/GUIDInfo';
4
+ import { BasicProperty } from './BasicProperty';
5
+ export declare const isInt32Property: (property: BasicProperty) => property is Int32Property;
6
+ export declare class Int32Property extends BasicProperty {
7
+ value: number;
8
+ constructor(value: number, ueType?: string, guidInfo?: GUIDInfo, index?: number);
9
+ static Parse(reader: BinaryReadable, ueType: string, index?: number): Int32Property;
10
+ static ReadValue(reader: BinaryReadable): number;
11
+ static CalcOverhead(property: Int32Property): number;
12
+ static Serialize(writer: ByteWriter, property: Int32Property): void;
13
+ static SerializeValue(writer: ByteWriter, value: number): void;
14
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Int32Property = exports.isInt32Property = void 0;
4
+ const GUIDInfo_1 = require("../../structs/GUIDInfo");
5
+ const BasicProperty_1 = require("./BasicProperty");
6
+ const isInt32Property = (property) => property.type === 'Int32Property';
7
+ exports.isInt32Property = isInt32Property;
8
+ class Int32Property extends BasicProperty_1.BasicProperty {
9
+ constructor(value, ueType = 'IntProperty', guidInfo = undefined, index = 0) {
10
+ super({ type: 'Int32Property', ueType, guidInfo, index });
11
+ this.value = value;
12
+ }
13
+ static Parse(reader, ueType, index = 0) {
14
+ const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
15
+ const value = Int32Property.ReadValue(reader);
16
+ return new Int32Property(value, ueType, guidInfo, index);
17
+ }
18
+ static ReadValue(reader) {
19
+ return reader.readInt32();
20
+ }
21
+ static CalcOverhead(property) {
22
+ return 1;
23
+ }
24
+ static Serialize(writer, property) {
25
+ GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
26
+ Int32Property.SerializeValue(writer, property.value);
27
+ }
28
+ static SerializeValue(writer, value) {
29
+ writer.writeInt32(value);
30
+ }
31
+ }
32
+ exports.Int32Property = Int32Property;
@@ -0,0 +1,14 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { GUIDInfo } from '../../structs/GUIDInfo';
4
+ import { BasicProperty } from './BasicProperty';
5
+ export declare const isInt64Property: (property: BasicProperty) => property is Int64Property;
6
+ export declare class Int64Property extends BasicProperty {
7
+ value: string;
8
+ constructor(value: string, ueType?: string, guidInfo?: GUIDInfo, index?: number);
9
+ static Parse(reader: BinaryReadable, ueType: string, index?: number): Int64Property;
10
+ static ReadValue(reader: BinaryReadable): string;
11
+ static CalcOverhead(property: Int64Property): number;
12
+ static Serialize(writer: ByteWriter, property: Int64Property): void;
13
+ static SerializeValue(writer: ByteWriter, value: string): void;
14
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Int64Property = exports.isInt64Property = void 0;
4
+ const GUIDInfo_1 = require("../../structs/GUIDInfo");
5
+ const BasicProperty_1 = require("./BasicProperty");
6
+ const isInt64Property = (property) => property.type === 'Int64Property';
7
+ exports.isInt64Property = isInt64Property;
8
+ class Int64Property extends BasicProperty_1.BasicProperty {
9
+ constructor(value, ueType = 'Int64Property', guidInfo = undefined, index = 0) {
10
+ super({ type: 'Int64Property', ueType, guidInfo, index });
11
+ this.value = value;
12
+ }
13
+ static Parse(reader, ueType, index = 0) {
14
+ const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
15
+ const value = Int64Property.ReadValue(reader);
16
+ return new Int64Property(value, ueType, guidInfo, index);
17
+ }
18
+ static ReadValue(reader) {
19
+ return reader.readInt64().toString();
20
+ }
21
+ static CalcOverhead(property) {
22
+ return 1;
23
+ }
24
+ static Serialize(writer, property) {
25
+ GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
26
+ Int64Property.SerializeValue(writer, property.value);
27
+ }
28
+ static SerializeValue(writer, value) {
29
+ writer.writeInt64(BigInt(value));
30
+ }
31
+ }
32
+ exports.Int64Property = Int64Property;
@@ -0,0 +1,14 @@
1
+ import { BinaryReadable } from '../../../../byte/binary-readable.interface';
2
+ import { ByteWriter } from '../../../../byte/byte-writer.class';
3
+ import { GUIDInfo } from '../../structs/GUIDInfo';
4
+ import { BasicProperty } from './BasicProperty';
5
+ export declare const isInt8Property: (property: BasicProperty) => property is Int8Property;
6
+ export declare class Int8Property extends BasicProperty {
7
+ value: number;
8
+ constructor(value: number, ueType?: string, guidInfo?: GUIDInfo, index?: number);
9
+ static Parse(reader: BinaryReadable, ueType: string, index?: number): Int8Property;
10
+ static ReadValue(reader: BinaryReadable): number;
11
+ static CalcOverhead(property: Int8Property): number;
12
+ static Serialize(writer: ByteWriter, property: Int8Property): void;
13
+ static SerializeValue(writer: ByteWriter, value: number): void;
14
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Int8Property = exports.isInt8Property = void 0;
4
+ const GUIDInfo_1 = require("../../structs/GUIDInfo");
5
+ const BasicProperty_1 = require("./BasicProperty");
6
+ const isInt8Property = (property) => property.type === 'Int8Property';
7
+ exports.isInt8Property = isInt8Property;
8
+ class Int8Property extends BasicProperty_1.BasicProperty {
9
+ constructor(value, ueType = 'Int8Property', guidInfo = undefined, index = 0) {
10
+ super({ type: 'Int8Property', ueType, guidInfo, index });
11
+ this.value = value;
12
+ }
13
+ static Parse(reader, ueType, index = 0) {
14
+ const guidInfo = GUIDInfo_1.GUIDInfo.read(reader);
15
+ const value = Int8Property.ReadValue(reader);
16
+ return new Int8Property(value, ueType, guidInfo, index);
17
+ }
18
+ static ReadValue(reader) {
19
+ return reader.readInt8();
20
+ }
21
+ static CalcOverhead(property) {
22
+ return 1;
23
+ }
24
+ static Serialize(writer, property) {
25
+ GUIDInfo_1.GUIDInfo.write(writer, property.guidInfo);
26
+ Int8Property.SerializeValue(writer, property.value);
27
+ }
28
+ static SerializeValue(writer, value) {
29
+ writer.writeInt8(value);
30
+ }
31
+ }
32
+ exports.Int8Property = Int8Property;