@etothepii/satisfactory-file-parser 1.0.2 → 1.1.1

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 (330) hide show
  1. package/LICENCE.md +1 -1
  2. package/LICENSE +1 -1
  3. package/README.md +19 -9
  4. package/build/index.d.ts +10 -1
  5. package/build/index.d.ts.map +1 -1
  6. package/build/index.js +10 -1
  7. package/build/index.js.map +1 -1
  8. package/build/parser/parser.d.ts +2 -6
  9. package/build/parser/parser.d.ts.map +1 -1
  10. package/build/parser/parser.js +5 -5
  11. package/build/parser/parser.js.map +1 -1
  12. package/build/parser/satisfactory/save/object-references-list.d.ts +2 -2
  13. package/build/parser/satisfactory/save/object-references-list.d.ts.map +1 -1
  14. package/build/parser/satisfactory/save/object-references-list.js.map +1 -1
  15. package/build/parser/satisfactory/types/objects/SaveObject.d.ts +2 -2
  16. package/build/parser/satisfactory/types/objects/SaveObject.d.ts.map +1 -1
  17. package/build/parser/satisfactory/types/objects/SaveObject.js +3 -3
  18. package/build/parser/satisfactory/types/objects/SaveObject.js.map +1 -1
  19. package/build/parser/satisfactory/types/property/PropertiesList.d.ts +3 -5
  20. package/build/parser/satisfactory/types/property/PropertiesList.d.ts.map +1 -1
  21. package/build/parser/satisfactory/types/property/PropertiesList.js +10 -13
  22. package/build/parser/satisfactory/types/property/PropertiesList.js.map +1 -1
  23. package/build/parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties.d.ts +31 -0
  24. package/build/parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties.d.ts.map +1 -0
  25. package/build/parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties.js +81 -0
  26. package/build/parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties.js.map +1 -0
  27. package/build/parser/satisfactory/types/property/special/CircuitSpecialProperties.d.ts +16 -0
  28. package/build/parser/satisfactory/types/property/special/CircuitSpecialProperties.d.ts.map +1 -0
  29. package/build/parser/satisfactory/types/property/special/CircuitSpecialProperties.js +31 -0
  30. package/build/parser/satisfactory/types/property/special/CircuitSpecialProperties.js.map +1 -0
  31. package/build/parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties.d.ts +40 -0
  32. package/build/parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties.d.ts.map +1 -0
  33. package/build/parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties.js +101 -0
  34. package/build/parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties.js.map +1 -0
  35. package/build/parser/satisfactory/types/property/special/ConveyorSpecialProperties.d.ts +11 -0
  36. package/build/parser/satisfactory/types/property/special/ConveyorSpecialProperties.d.ts.map +1 -0
  37. package/build/parser/satisfactory/types/property/special/ConveyorSpecialProperties.js +18 -0
  38. package/build/parser/satisfactory/types/property/special/ConveyorSpecialProperties.js.map +1 -0
  39. package/build/parser/satisfactory/types/property/special/EmptySpecialProperties.d.ts +11 -0
  40. package/build/parser/satisfactory/types/property/special/EmptySpecialProperties.d.ts.map +1 -0
  41. package/build/parser/satisfactory/types/property/special/EmptySpecialProperties.js +15 -0
  42. package/build/parser/satisfactory/types/property/special/EmptySpecialProperties.js.map +1 -0
  43. package/build/parser/satisfactory/types/property/special/ObjectsListSpecialProperties.d.ts +13 -0
  44. package/build/parser/satisfactory/types/property/special/ObjectsListSpecialProperties.d.ts.map +1 -0
  45. package/build/parser/satisfactory/types/property/special/ObjectsListSpecialProperties.js +20 -0
  46. package/build/parser/satisfactory/types/property/special/ObjectsListSpecialProperties.js.map +1 -0
  47. package/build/parser/satisfactory/types/property/special/PlayerSpecialProperties.d.ts +14 -0
  48. package/build/parser/satisfactory/types/property/special/PlayerSpecialProperties.d.ts.map +1 -0
  49. package/build/parser/satisfactory/types/property/special/PlayerSpecialProperties.js +40 -0
  50. package/build/parser/satisfactory/types/property/special/PlayerSpecialProperties.js.map +1 -0
  51. package/build/parser/satisfactory/types/property/special/PowerLineSpecialProperties.d.ts +17 -0
  52. package/build/parser/satisfactory/types/property/special/PowerLineSpecialProperties.d.ts.map +1 -0
  53. package/build/parser/satisfactory/types/property/special/PowerLineSpecialProperties.js +28 -0
  54. package/build/parser/satisfactory/types/property/special/PowerLineSpecialProperties.js.map +1 -0
  55. package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.d.ts +18 -0
  56. package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.d.ts.map +1 -0
  57. package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.js +47 -0
  58. package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.js.map +1 -0
  59. package/build/parser/satisfactory/types/property/special/SpecialProperties.d.ts +13 -3
  60. package/build/parser/satisfactory/types/property/special/SpecialProperties.d.ts.map +1 -1
  61. package/build/parser/satisfactory/types/property/special/SpecialProperties.js +75 -195
  62. package/build/parser/satisfactory/types/property/special/SpecialProperties.js.map +1 -1
  63. package/build/parser/satisfactory/types/property/special/VehicleSpecialProperties.d.ts +19 -0
  64. package/build/parser/satisfactory/types/property/special/VehicleSpecialProperties.d.ts.map +1 -0
  65. package/build/parser/satisfactory/types/property/special/VehicleSpecialProperties.js +46 -0
  66. package/build/parser/satisfactory/types/property/special/VehicleSpecialProperties.js.map +1 -0
  67. package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.d.ts.map +1 -1
  68. package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.js +2 -21
  69. package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.js.map +1 -1
  70. package/build/parser/satisfactory/types/structs/GUID.d.ts +2 -2
  71. package/build/parser/satisfactory/types/structs/GUID.d.ts.map +1 -1
  72. package/build/parser/satisfactory/types/structs/GUID.js.map +1 -1
  73. package/build/parser/satisfactory/types/structs/GUIDInfo.d.ts +2 -2
  74. package/build/parser/satisfactory/types/structs/GUIDInfo.d.ts.map +1 -1
  75. package/build/parser/satisfactory/types/structs/GUIDInfo.js.map +1 -1
  76. package/build/parser/satisfactory/types/structs/ObjectReference.d.ts +2 -2
  77. package/build/parser/satisfactory/types/structs/ObjectReference.d.ts.map +1 -1
  78. package/build/parser/satisfactory/types/structs/ObjectReference.js.map +1 -1
  79. package/build/parser/satisfactory/types/structs/Transform.d.ts +3 -3
  80. package/build/parser/satisfactory/types/structs/Transform.d.ts.map +1 -1
  81. package/build/parser/satisfactory/types/structs/Transform.js.map +1 -1
  82. package/build/parser/satisfactory/types/structs/col4.d.ts +3 -3
  83. package/build/parser/satisfactory/types/structs/col4.d.ts.map +1 -1
  84. package/build/parser/satisfactory/types/structs/col4.js.map +1 -1
  85. package/build/parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange.d.ts +2 -2
  86. package/build/parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange.d.ts.map +1 -1
  87. package/build/parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange.js.map +1 -1
  88. package/build/parser/satisfactory/types/structs/vec2.d.ts +3 -3
  89. package/build/parser/satisfactory/types/structs/vec2.d.ts.map +1 -1
  90. package/build/parser/satisfactory/types/structs/vec2.js.map +1 -1
  91. package/build/parser/satisfactory/types/structs/vec3.d.ts +4 -4
  92. package/build/parser/satisfactory/types/structs/vec3.d.ts.map +1 -1
  93. package/build/parser/satisfactory/types/structs/vec3.js.map +1 -1
  94. package/build/parser/satisfactory/types/structs/vec4.d.ts +3 -3
  95. package/build/parser/satisfactory/types/structs/vec4.d.ts.map +1 -1
  96. package/build/parser/satisfactory/types/structs/vec4.js.map +1 -1
  97. package/docs/assets/navigation.js +1 -1
  98. package/docs/assets/search.js +1 -1
  99. package/docs/classes/AbstractBaseProperty.html +2 -2
  100. package/docs/classes/AbstractProperty.html +2 -2
  101. package/docs/classes/ArrayProperty.html +2 -2
  102. package/docs/classes/BasicProperty.html +2 -2
  103. package/docs/classes/BlueprintConfigReader.html +3 -3
  104. package/docs/classes/BlueprintConfigWriter.html +3 -3
  105. package/docs/classes/BlueprintReader.html +3 -3
  106. package/docs/classes/BlueprintWriter.html +3 -3
  107. package/docs/classes/BoolProperty.html +2 -2
  108. package/docs/classes/ByteProperty.html +2 -2
  109. package/docs/classes/CompressionLibraryError.html +2 -2
  110. package/docs/classes/CorruptSaveError.html +2 -2
  111. package/docs/classes/DoubleProperty.html +2 -2
  112. package/docs/classes/EnumProperty.html +2 -2
  113. package/docs/classes/FloatProperty.html +2 -2
  114. package/docs/classes/Int32Property.html +2 -2
  115. package/docs/classes/Int64Property.html +2 -2
  116. package/docs/classes/Int8Property.html +2 -2
  117. package/docs/classes/MapProperty.html +2 -2
  118. package/docs/classes/ObjectProperty.html +2 -2
  119. package/docs/classes/Parser.html +8 -8
  120. package/docs/classes/ParserError.html +2 -2
  121. package/docs/classes/ReadableStreamParser.html +2 -2
  122. package/docs/classes/SatisfactorySave.html +2 -2
  123. package/docs/classes/SaveComponent.html +2 -2
  124. package/docs/classes/SaveEntity.html +2 -2
  125. package/docs/classes/SaveReader.html +3 -3
  126. package/docs/classes/SaveStreamJsonStringifier.html +2 -2
  127. package/docs/classes/SaveStreamWriter.html +2 -2
  128. package/docs/classes/SaveWriter.html +3 -3
  129. package/docs/classes/SetProperty.html +2 -2
  130. package/docs/classes/StrProperty.html +2 -2
  131. package/docs/classes/StructProperty.html +2 -2
  132. package/docs/classes/TextProperty.html +2 -2
  133. package/docs/classes/TimeoutError.html +2 -2
  134. package/docs/classes/Uint32Property.html +2 -2
  135. package/docs/classes/Uint64Property.html +2 -2
  136. package/docs/classes/Uint8Property.html +2 -2
  137. package/docs/classes/UnimplementedError.html +2 -2
  138. package/docs/classes/UnsupportedVersionError.html +2 -2
  139. package/docs/functions/BuildableSubsystemSpecialProperties.Parse.html +1 -0
  140. package/docs/functions/BuildableSubsystemSpecialProperties.Serialize.html +1 -0
  141. package/docs/functions/CircuitSpecialProperties.Parse.html +1 -0
  142. package/docs/functions/CircuitSpecialProperties.Serialize.html +1 -0
  143. package/docs/functions/ConveyorChainActorSpecialProperties.Parse.html +1 -0
  144. package/docs/functions/ConveyorChainActorSpecialProperties.Serialize.html +1 -0
  145. package/docs/functions/ConveyorSpecialProperties.Parse.html +1 -0
  146. package/docs/functions/ConveyorSpecialProperties.Serialize.html +1 -0
  147. package/docs/functions/DynamicStructPropertyValue.read.html +1 -1
  148. package/docs/functions/DynamicStructPropertyValue.write.html +1 -1
  149. package/docs/functions/EmptySpecialProperties.Parse.html +1 -0
  150. package/docs/functions/EmptySpecialProperties.Serialize.html +1 -0
  151. package/docs/functions/FICFrameRange.Parse.html +1 -1
  152. package/docs/functions/FICFrameRange.Serialize.html +1 -1
  153. package/docs/functions/GUID.read.html +1 -1
  154. package/docs/functions/GUID.write.html +1 -1
  155. package/docs/functions/GUIDInfo.read.html +1 -1
  156. package/docs/functions/GUIDInfo.write.html +1 -1
  157. package/docs/functions/Level.ReadAllObjectContents.html +1 -1
  158. package/docs/functions/Level.ReadAllObjectHeaders.html +1 -1
  159. package/docs/functions/Level.ReadLevel.html +1 -1
  160. package/docs/functions/Level.ReadNObjectContents.html +1 -1
  161. package/docs/functions/Level.ReadNObjectHeaders.html +1 -1
  162. package/docs/functions/Level.SerializeAllObjectContents.html +1 -1
  163. package/docs/functions/Level.SerializeAllObjectHeaders.html +1 -1
  164. package/docs/functions/Level.SerializeLevel.html +1 -1
  165. package/docs/functions/MD5Hash.read.html +1 -1
  166. package/docs/functions/MD5Hash.write.html +1 -1
  167. package/docs/functions/ObjectReference.read.html +1 -1
  168. package/docs/functions/ObjectReference.write.html +1 -1
  169. package/docs/functions/ObjectsListSpecialProperties.Parse.html +1 -0
  170. package/docs/functions/ObjectsListSpecialProperties.Serialize.html +1 -0
  171. package/docs/functions/PlayerSpecialProperties.Parse.html +1 -0
  172. package/docs/functions/PlayerSpecialProperties.Serialize.html +1 -0
  173. package/docs/functions/PowerLineSpecialProperties.Parse.html +1 -0
  174. package/docs/functions/PowerLineSpecialProperties.Serialize.html +1 -0
  175. package/docs/functions/PropertiesList.ParseList.html +1 -1
  176. package/docs/functions/PropertiesList.ParseSingleProperty.html +1 -1
  177. package/docs/functions/PropertiesList.SerializeList.html +1 -1
  178. package/docs/functions/PropertiesList.SerializeSingleProperty.html +1 -1
  179. package/docs/functions/SoftObjectReference.read.html +1 -1
  180. package/docs/functions/SoftObjectReference.write.html +1 -1
  181. package/docs/functions/SpecialDroneActionProperties.Parse.html +1 -0
  182. package/docs/functions/SpecialDroneActionProperties.Serialize.html +1 -0
  183. package/docs/functions/SpecialProperties.ParseClassSpecificSpecialProperties.html +1 -1
  184. package/docs/functions/SpecialProperties.SerializeClassSpecificSpecialProperties.html +1 -1
  185. package/docs/functions/Transform.Parse.html +1 -1
  186. package/docs/functions/Transform.ParseF.html +1 -1
  187. package/docs/functions/Transform.Serialize.html +1 -1
  188. package/docs/functions/Transform.SerializeF.html +1 -1
  189. package/docs/functions/VehicleSpecialProperties.Parse.html +1 -0
  190. package/docs/functions/VehicleSpecialProperties.Serialize.html +1 -0
  191. package/docs/functions/col4.ParseBGRA.html +1 -1
  192. package/docs/functions/col4.ParseRGBA.html +1 -1
  193. package/docs/functions/col4.SerializeBGRA.html +1 -1
  194. package/docs/functions/col4.SerializeRGBA.html +1 -1
  195. package/docs/functions/isArrayProperty.html +1 -1
  196. package/docs/functions/isBoolProperty.html +1 -1
  197. package/docs/functions/isBuildableSubsystemSpecialProperties.html +1 -0
  198. package/docs/functions/isByteProperty.html +1 -1
  199. package/docs/functions/isCircuitSpecialProperties.html +1 -0
  200. package/docs/functions/isConveyorChainActorSpecialProperties.html +1 -0
  201. package/docs/functions/isConveyorSpecialProperties.html +1 -0
  202. package/docs/functions/isDoubleProperty.html +1 -1
  203. package/docs/functions/isEmptySpecialProperties.html +1 -0
  204. package/docs/functions/isEnumProperty.html +1 -1
  205. package/docs/functions/isFloatProperty.html +1 -1
  206. package/docs/functions/isInt32Property.html +1 -1
  207. package/docs/functions/isInt64Property.html +1 -1
  208. package/docs/functions/isInt8Property.html +1 -1
  209. package/docs/functions/isMapProperty.html +1 -1
  210. package/docs/functions/isObjectProperty.html +1 -1
  211. package/docs/functions/isObjectsListSpecialProperties.html +1 -0
  212. package/docs/functions/isPlayerSpecialProperties.html +1 -0
  213. package/docs/functions/isPowerLineSpecialProperties.html +1 -0
  214. package/docs/functions/isSaveComponent.html +1 -1
  215. package/docs/functions/isSaveEntity.html +1 -1
  216. package/docs/functions/isSetProperty.html +1 -1
  217. package/docs/functions/isSpecialDroneActionProperties.html +1 -0
  218. package/docs/functions/isStrProperty.html +1 -1
  219. package/docs/functions/isStructProperty.html +1 -1
  220. package/docs/functions/isTextProperty.html +1 -1
  221. package/docs/functions/isUInt64Property.html +1 -1
  222. package/docs/functions/isUint32Property.html +1 -1
  223. package/docs/functions/isUint8Property.html +1 -1
  224. package/docs/functions/isVehicleSpecialProperties.html +1 -0
  225. package/docs/functions/vec2.Parse.html +1 -1
  226. package/docs/functions/vec2.ParseF.html +1 -1
  227. package/docs/functions/vec2.Serialize.html +1 -1
  228. package/docs/functions/vec2.SerializeF.html +1 -1
  229. package/docs/functions/vec3.Parse.html +1 -1
  230. package/docs/functions/vec3.ParseF.html +1 -1
  231. package/docs/functions/vec3.ParseInt.html +1 -1
  232. package/docs/functions/vec3.Serialize.html +1 -1
  233. package/docs/functions/vec3.SerializeF.html +1 -1
  234. package/docs/functions/vec3.SerializeInt.html +1 -1
  235. package/docs/functions/vec3.add.html +1 -1
  236. package/docs/functions/vec3.length.html +1 -1
  237. package/docs/functions/vec3.mult.html +1 -1
  238. package/docs/functions/vec3.norm.html +1 -1
  239. package/docs/functions/vec3.sub.html +1 -1
  240. package/docs/functions/vec4.Parse.html +1 -1
  241. package/docs/functions/vec4.ParseF.html +1 -1
  242. package/docs/functions/vec4.Serialize.html +1 -1
  243. package/docs/functions/vec4.SerializeF.html +1 -1
  244. package/docs/index.html +15 -4
  245. package/docs/interfaces/Blueprint.html +2 -2
  246. package/docs/interfaces/BlueprintConfig.html +2 -2
  247. package/docs/interfaces/ModData.html +2 -2
  248. package/docs/interfaces/SatisfactoryModMetadata.html +2 -2
  249. package/docs/interfaces/SatisfactorySaveHeader.html +2 -2
  250. package/docs/interfaces/SaveComponentHeader.html +2 -2
  251. package/docs/interfaces/SaveEntityHeader.html +2 -2
  252. package/docs/modules/BuildableSubsystemSpecialProperties.html +3 -0
  253. package/docs/modules/CircuitSpecialProperties.html +3 -0
  254. package/docs/modules/ConveyorChainActorSpecialProperties.html +3 -0
  255. package/docs/modules/ConveyorSpecialProperties.html +3 -0
  256. package/docs/modules/DynamicStructPropertyValue.html +1 -1
  257. package/docs/modules/EmptySpecialProperties.html +3 -0
  258. package/docs/modules/FICFrameRange.html +1 -1
  259. package/docs/modules/GUID.html +1 -1
  260. package/docs/modules/GUIDInfo.html +1 -1
  261. package/docs/modules/Level.html +1 -1
  262. package/docs/modules/MD5Hash.html +1 -1
  263. package/docs/modules/ObjectReference.html +1 -1
  264. package/docs/modules/ObjectsListSpecialProperties.html +3 -0
  265. package/docs/modules/PlayerSpecialProperties.html +3 -0
  266. package/docs/modules/PowerLineSpecialProperties.html +3 -0
  267. package/docs/modules/PropertiesList.html +1 -1
  268. package/docs/modules/SoftObjectReference.html +1 -1
  269. package/docs/modules/SpecialDroneActionProperties.html +3 -0
  270. package/docs/modules/SpecialProperties.html +2 -1
  271. package/docs/modules/Transform.html +1 -1
  272. package/docs/modules/VehicleSpecialProperties.html +3 -0
  273. package/docs/modules/col4.html +1 -1
  274. package/docs/modules/vec2.html +1 -1
  275. package/docs/modules/vec3.html +1 -1
  276. package/docs/modules/vec4.html +1 -1
  277. package/docs/modules.html +32 -7
  278. package/docs/types/ArrayPropertyStructValueFields.html +1 -1
  279. package/docs/types/BasicMultipleStructPropertyValue.html +1 -1
  280. package/docs/types/BasicStructPropertyValue.html +1 -1
  281. package/docs/types/BlueprintHeader.html +1 -1
  282. package/docs/types/BoxStructPropertyValue.html +1 -1
  283. package/docs/types/BuildableSubsystemSpecialProperties-1.html +1 -0
  284. package/docs/types/BuildableTypeInstance.html +1 -1
  285. package/docs/types/BytePropertyValue.html +1 -1
  286. package/docs/types/CircuitSpecialProperties-1.html +1 -0
  287. package/docs/types/ClientIdentityInfo.html +1 -1
  288. package/docs/types/ConveyorChainActorSpecialProperties-1.html +1 -0
  289. package/docs/types/ConveyorChainSegmentSpecialProperties.html +1 -1
  290. package/docs/types/ConveyorItemSpecialProperties.html +1 -1
  291. package/docs/types/ConveyorSpecialProperties-1.html +1 -0
  292. package/docs/types/DynamicStructPropertyValue-1.html +1 -1
  293. package/docs/types/EmptySpecialProperties-1.html +1 -0
  294. package/docs/types/FICFrameRange-1.html +1 -1
  295. package/docs/types/FICFrameRangeStructPropertyValue.html +1 -1
  296. package/docs/types/GENERIC_MAP_KEY_TYPE.html +1 -1
  297. package/docs/types/GENERIC_MAP_VALUE_TYPE.html +1 -1
  298. package/docs/types/GENERIC_STRUCT_PROPERTY_VALUE.html +1 -1
  299. package/docs/types/GUID-1.html +1 -1
  300. package/docs/types/GUIDInfo-1.html +1 -1
  301. package/docs/types/InventoryItemStructPropertyValue.html +1 -1
  302. package/docs/types/Level-1.html +1 -1
  303. package/docs/types/MAP_STRUCT_KEY_PROXY.html +1 -1
  304. package/docs/types/MD5Hash-1.html +1 -1
  305. package/docs/types/ObjectReference-1.html +1 -1
  306. package/docs/types/ObjectsListSpecialProperties-1.html +1 -0
  307. package/docs/types/PlayerSpecialProperties-1.html +1 -0
  308. package/docs/types/PowerLineSpecialProperties-1.html +1 -0
  309. package/docs/types/PropertiesMap.html +1 -1
  310. package/docs/types/RailroadTrackPositionStructPropertyValue.html +1 -1
  311. package/docs/types/RoughSaveVersion.html +1 -1
  312. package/docs/types/SoftObjectReference-1.html +1 -1
  313. package/docs/types/SpecialDroneAction.html +1 -0
  314. package/docs/types/SpecialDroneActionProperties-1.html +1 -0
  315. package/docs/types/SpecialProperties.AvailableSpecialPropertiesTypes.html +1 -0
  316. package/docs/types/TextPropertyValue.html +1 -1
  317. package/docs/types/Transform-1.html +1 -1
  318. package/docs/types/VehicleSpecialProperties-1.html +1 -0
  319. package/docs/types/col4-1.html +1 -1
  320. package/docs/types/vec2-1.html +1 -1
  321. package/docs/types/vec3-1.html +1 -1
  322. package/docs/types/vec4-1.html +1 -1
  323. package/docs/variables/EDIT.html +1 -1
  324. package/package.json +1 -1
  325. package/docs/types/BuildableSubsystemSpecialProperties.html +0 -1
  326. package/docs/types/ConveyorChainActorSpecialProperties.html +0 -1
  327. package/docs/types/EmptySpecialProperties.html +0 -1
  328. package/docs/types/PlayerSpecialProperties.html +0 -1
  329. package/docs/types/PowerLineSpecialProperties.html +0 -1
  330. package/docs/types/SpecialAnyProperties.html +0 -1
package/LICENCE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 etothepii
3
+ Copyright (c) 2021-2024 etothepii
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2024 etothepii
3
+ Copyright (c) 2021-2024 etothepii
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -75,9 +75,7 @@ import { Parser } from "@etothepii/satisfactory-file-parser";
75
75
 
76
76
  let fileHeader: Uint8Array;
77
77
  const bodyChunks: Uint8Array[] = [];
78
- Parser.WriteSave(save, binaryBeforeCompressed => {
79
- console.log('on binary data before being compressed.');
80
- }, header => {
78
+ Parser.WriteSave(save, header => {
81
79
  console.log('on save header.');
82
80
  fileHeader = header;
83
81
  }, chunk => {
@@ -124,15 +122,16 @@ import { Parser } from "@etothepii/satisfactory-file-parser";
124
122
 
125
123
  let mainFileHeader: Uint8Array;
126
124
  const mainFileBodyChunks: Uint8Array[] = [];
127
- const summary = Parser.WriteBlueprintFiles(blueprint, {
128
- onMainFileHeader: header => {
125
+ const summary = Parser.WriteBlueprintFiles(blueprint,
126
+ header => {
129
127
  console.log('on main file header.');
130
128
  mainFileHeader = header;
131
- }, onMainFileChunk: chunk => {
129
+ },
130
+ chunk => {
132
131
  console.log('on main file body chunk.');
133
132
  mainFileBodyChunks.push(chunk);
134
133
  }
135
- });
134
+ );
136
135
 
137
136
  // write complete .sbp file back to disk
138
137
  fs.writeFileSync('./MyBlueprint.sbp', Buffer.concat([mainFileHeader!, ...mainFileBodyChunks]));
@@ -165,8 +164,19 @@ const blueprint = Parser.ParseBlueprintFiles('Myblueprint', file, configFile, {
165
164
  You can always raise an issue on the linked github project or hit me up on the satisfactory discord `etothepii`.
166
165
 
167
166
  # Changelog
168
- ## [1.0.2] (2024-10-17)
169
- #### `...SpecialProperty` got all renamed to `...SpecialProperties`.
167
+ ### [1.1.1] (2024-10-21)
168
+ #### Improved Special Properties
169
+ * Improved on SpecialProperties of BuildableSubsystem and ConveyorChainActor as the meaning became more clear.
170
+ * Special Properties are refactored into their own namespaces and exported.
171
+ * The union type `SpecialAnyProperties` is now automatically derived and more concisely named `SpecialProperties.AvailableSpecialPropertiesTypes` instead, in case you need it.
172
+
173
+ ### [1.0.3] (2024-10-17)
174
+ #### Hotfix
175
+ * fix being forced to use callbacks when writing saves or blueprints.
176
+
177
+ ### [1.0.2] (2024-10-17)
178
+ #### Internal renaming
179
+ * `...SpecialProperty` got all renamed to `...SpecialProperties`.
170
180
 
171
181
  ### [1.0.1] (2024-10-17)
172
182
  #### Major breaking changes on Parser usage
package/build/index.d.ts CHANGED
@@ -24,8 +24,17 @@ export * from './parser/satisfactory/types/property/generic/Uint32Property';
24
24
  export * from './parser/satisfactory/types/property/generic/Uint64Property';
25
25
  export * from './parser/satisfactory/types/property/generic/Uint8Property';
26
26
  export * from './parser/satisfactory/types/property/PropertiesList';
27
- export * from './parser/satisfactory/types/property/special/SpecialAnyProperties';
27
+ export * from './parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties';
28
+ export * from './parser/satisfactory/types/property/special/CircuitSpecialProperties';
29
+ export * from './parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties';
30
+ export * from './parser/satisfactory/types/property/special/ConveyorSpecialProperties';
31
+ export * from './parser/satisfactory/types/property/special/EmptySpecialProperties';
32
+ export * from './parser/satisfactory/types/property/special/ObjectsListSpecialProperties';
33
+ export * from './parser/satisfactory/types/property/special/PlayerSpecialProperties';
34
+ export * from './parser/satisfactory/types/property/special/PowerLineSpecialProperties';
35
+ export * from './parser/satisfactory/types/property/special/SpecialDroneActionProperties';
28
36
  export * from './parser/satisfactory/types/property/special/SpecialProperties';
37
+ export * from './parser/satisfactory/types/property/special/VehicleSpecialProperties';
29
38
  export * from './parser/satisfactory/types/structs/col4';
30
39
  export * from './parser/satisfactory/types/structs/DynamicStructPropertyValue';
31
40
  export * from './parser/satisfactory/types/structs/GUID';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,iDAAiD,CAAC;AAChE,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,uCAAuC,CAAC;AACtD,cAAc,mDAAmD,CAAC;AAClE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,6DAA6D,CAAC;AAC5E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,0DAA0D,CAAC;AACzE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,0DAA0D,CAAC;AACzE,cAAc,0DAA0D,CAAC;AACzE,cAAc,6DAA6D,CAAC;AAC5E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,6DAA6D,CAAC;AAC5E,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,qDAAq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ACpE,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAGrF,cAAc,6BAA6B,CAAC;AAG5C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iDAAiD,CAAC;AAGvF,cAAc,2CAA2C,CAAC"}
package/build/index.js CHANGED
@@ -41,8 +41,17 @@ __exportStar(require("./parser/satisfactory/types/property/generic/Uint32Propert
41
41
  __exportStar(require("./parser/satisfactory/types/property/generic/Uint64Property"), exports);
42
42
  __exportStar(require("./parser/satisfactory/types/property/generic/Uint8Property"), exports);
43
43
  __exportStar(require("./parser/satisfactory/types/property/PropertiesList"), exports);
44
- __exportStar(require("./parser/satisfactory/types/property/special/SpecialAnyProperties"), exports);
44
+ __exportStar(require("./parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties"), exports);
45
+ __exportStar(require("./parser/satisfactory/types/property/special/CircuitSpecialProperties"), exports);
46
+ __exportStar(require("./parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties"), exports);
47
+ __exportStar(require("./parser/satisfactory/types/property/special/ConveyorSpecialProperties"), exports);
48
+ __exportStar(require("./parser/satisfactory/types/property/special/EmptySpecialProperties"), exports);
49
+ __exportStar(require("./parser/satisfactory/types/property/special/ObjectsListSpecialProperties"), exports);
50
+ __exportStar(require("./parser/satisfactory/types/property/special/PlayerSpecialProperties"), exports);
51
+ __exportStar(require("./parser/satisfactory/types/property/special/PowerLineSpecialProperties"), exports);
52
+ __exportStar(require("./parser/satisfactory/types/property/special/SpecialDroneActionProperties"), exports);
45
53
  __exportStar(require("./parser/satisfactory/types/property/special/SpecialProperties"), exports);
54
+ __exportStar(require("./parser/satisfactory/types/property/special/VehicleSpecialProperties"), exports);
46
55
  __exportStar(require("./parser/satisfactory/types/structs/col4"), exports);
47
56
  __exportStar(require("./parser/satisfactory/types/structs/DynamicStructPropertyValue"), exports);
48
57
  __exportStar(require("./parser/satisfactory/types/structs/GUID"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,kFAAgE;AAChE,yEAAuD;AACvD,+EAA6D;AAC7D,wEAAsD;AACtD,oFAAkE;AAClE,iFAA+D;AAC/D,6FAA2E;AAC3E,6FAA2E;AAC3E,4FAA0E;AAC1E,4FAA0E;AAC1E,8FAA4E;AAC5E,4FAA0E;AAC1E,6FAA2E;AAC3E,6FAA2E;AAC3E,6FAA2E;AAC3E,4FAA0E;AAC1E,2FAAyE;AACzE,8FAA4E;AAC5E,2FAAyE;AACzE,2FAAyE;AACzE,8FAA4E;AAC5E,4FAA0E;AAC1E,8FAA4E;AAC5E,8FAA4E;AAC5E,6FAA2E;AAC3E,sFAAoE;AACpE,oGAAkF;AAClF,iGAA+E;AAC/E,2EAAyD;AACzD,iGAA+E;AAC/E,2EAAyD;AACzD,+EAA6D;AAC7D,8EAA4D;AAC5D,mGAAiF;AACjF,sFAAoE;AACpE,0FAAwE;AACxE,gFAA8D;AAC9D,2EAAyD;AACzD,2EAAyD;AACzD,2EAAyD;AAGzD,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,sEAAoE;AAA3D,yGAAA,UAAU,OAAA;AACnB,sEAAoE;AAA3D,yGAAA,UAAU,OAAA;AACnB,sGAAkG;AAAzF,yIAAA,yBAAyB,OAAA;AAClC,8FAAqF;AAA5E,4HAAA,gBAAgB,OAAA;AAGzB,8DAA4C;AAG5C,0CAAyC;AAAhC,gGAAA,MAAM,OAAA;AACf,0FAAuF;AAA9E,8HAAA,oBAAoB,OAAA;AAG7B,4EAA0D","sourcesContent":["// types & classes for convenience\nexport * from './parser/satisfactory/blueprint/blueprint.types';\nexport * from './parser/satisfactory/save/level.class';\nexport * from './parser/satisfactory/save/satisfactory-save';\nexport * from './parser/satisfactory/save/save.types';\nexport * from './parser/satisfactory/types/objects/SaveComponent';\nexport * from './parser/satisfactory/types/objects/SaveEntity';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/BasicProperty';\nexport * from './parser/satisfactory/types/property/generic/BoolProperty';\nexport * from './parser/satisfactory/types/property/generic/ByteProperty';\nexport * from './parser/satisfactory/types/property/generic/DoubleProperty';\nexport * from './parser/satisfactory/types/property/generic/EnumProperty';\nexport * from './parser/satisfactory/types/property/generic/FloatProperty';\nexport * from './parser/satisfactory/types/property/generic/Int32Property';\nexport * from './parser/satisfactory/types/property/generic/Int64Property';\nexport * from './parser/satisfactory/types/property/generic/Int8Property';\nexport * from './parser/satisfactory/types/property/generic/MapProperty';\nexport * from './parser/satisfactory/types/property/generic/ObjectProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty';\nexport * from './parser/satisfactory/types/property/generic/StrProperty';\nexport * from './parser/satisfactory/types/property/generic/StructProperty';\nexport * from './parser/satisfactory/types/property/generic/TextProperty';\nexport * from './parser/satisfactory/types/property/generic/Uint32Property';\nexport * from './parser/satisfactory/types/property/generic/Uint64Property';\nexport * from './parser/satisfactory/types/property/generic/Uint8Property';\nexport * from './parser/satisfactory/types/property/PropertiesList';\nexport * from './parser/satisfactory/types/property/special/SpecialAnyProperties';\nexport * from './parser/satisfactory/types/property/special/SpecialProperties';\nexport * from './parser/satisfactory/types/structs/col4';\nexport * from './parser/satisfactory/types/structs/DynamicStructPropertyValue';\nexport * from './parser/satisfactory/types/structs/GUID';\nexport * from './parser/satisfactory/types/structs/GUIDInfo';\nexport * from './parser/satisfactory/types/structs/MD5Hash';\nexport * from './parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange';\nexport * from './parser/satisfactory/types/structs/ObjectReference';\nexport * from './parser/satisfactory/types/structs/SoftObjectReference';\nexport * from './parser/satisfactory/types/structs/Transform';\nexport * from './parser/satisfactory/types/structs/vec2';\nexport * from './parser/satisfactory/types/structs/vec3';\nexport * from './parser/satisfactory/types/structs/vec4';\n\n// should better be removed in a future update to prevent shenanigans.\nexport { BlueprintConfigReader, BlueprintReader } from './parser/satisfactory/blueprint/blueprint-reader';\nexport { BlueprintConfigWriter, BlueprintWriter } from './parser/satisfactory/blueprint/blueprint-writer';\nexport { SaveReader } from './parser/satisfactory/save/save-reader';\nexport { SaveWriter } from './parser/satisfactory/save/save-writer';\nexport { SaveStreamJsonStringifier } from './parser/stream/reworked/save-stream-json-stringifier';\nexport { SaveStreamWriter } from './parser/stream/reworked/save-stream-writer.class';\n\n// errors\nexport * from './parser/error/parser.error';\n\n// facade\nexport { Parser } from './parser/parser';\nexport { ReadableStreamParser } from './parser/stream/reworked/readable-stream-parser';\n\n// edit\nexport * from './parser/satisfactory/edit/edit-constants';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,kFAAgE;AAChE,yEAAuD;AACvD,+EAA6D;AAC7D,wEAAsD;AACtD,oFAAkE;AAClE,iFAA+D;AAC/D,6FAA2E;AAC3E,6FAA2E;AAC3E,4FAA0E;AAC1E,4FAA0E;AAC1E,8FAA4E;AAC5E,4FAA0E;AAC1E,6FAA2E;AAC3E,6FAA2E;AAC3E,6FAA2E;AAC3E,4FAA0E;AAC1E,2FAAyE;AACzE,8FAA4E;AAC5E,2FAAyE;AACzE,2FAAyE;AACzE,8FAA4E;AAC5E,4FAA0E;AAC1E,8FAA4E;AAC5E,8FAA4E;AAC5E,6FAA2E;AAC3E,sFAAoE;AACpE,mHAAiG;AACjG,wGAAsF;AACtF,mHAAiG;AACjG,yGAAuF;AACvF,sGAAoF;AACpF,4GAA0F;AAC1F,uGAAqF;AACrF,0GAAwF;AACxF,4GAA0F;AAC1F,iGAA+E;AAC/E,wGAAsF;AACtF,2EAAyD;AACzD,iGAA+E;AAC/E,2EAAyD;AACzD,+EAA6D;AAC7D,8EAA4D;AAC5D,mGAAiF;AACjF,sFAAoE;AACpE,0FAAwE;AACxE,gFAA8D;AAC9D,2EAAyD;AACzD,2EAAyD;AACzD,2EAAyD;AAGzD,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,sEAAoE;AAA3D,yGAAA,UAAU,OAAA;AACnB,sEAAoE;AAA3D,yGAAA,UAAU,OAAA;AACnB,sGAAkG;AAAzF,yIAAA,yBAAyB,OAAA;AAClC,8FAAqF;AAA5E,4HAAA,gBAAgB,OAAA;AAGzB,8DAA4C;AAG5C,0CAAyC;AAAhC,gGAAA,MAAM,OAAA;AACf,0FAAuF;AAA9E,8HAAA,oBAAoB,OAAA;AAG7B,4EAA0D","sourcesContent":["// types & classes for convenience\nexport * from './parser/satisfactory/blueprint/blueprint.types';\nexport * from './parser/satisfactory/save/level.class';\nexport * from './parser/satisfactory/save/satisfactory-save';\nexport * from './parser/satisfactory/save/save.types';\nexport * from './parser/satisfactory/types/objects/SaveComponent';\nexport * from './parser/satisfactory/types/objects/SaveEntity';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/BasicProperty';\nexport * from './parser/satisfactory/types/property/generic/BoolProperty';\nexport * from './parser/satisfactory/types/property/generic/ByteProperty';\nexport * from './parser/satisfactory/types/property/generic/DoubleProperty';\nexport * from './parser/satisfactory/types/property/generic/EnumProperty';\nexport * from './parser/satisfactory/types/property/generic/FloatProperty';\nexport * from './parser/satisfactory/types/property/generic/Int32Property';\nexport * from './parser/satisfactory/types/property/generic/Int64Property';\nexport * from './parser/satisfactory/types/property/generic/Int8Property';\nexport * from './parser/satisfactory/types/property/generic/MapProperty';\nexport * from './parser/satisfactory/types/property/generic/ObjectProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty';\nexport * from './parser/satisfactory/types/property/generic/StrProperty';\nexport * from './parser/satisfactory/types/property/generic/StructProperty';\nexport * from './parser/satisfactory/types/property/generic/TextProperty';\nexport * from './parser/satisfactory/types/property/generic/Uint32Property';\nexport * from './parser/satisfactory/types/property/generic/Uint64Property';\nexport * from './parser/satisfactory/types/property/generic/Uint8Property';\nexport * from './parser/satisfactory/types/property/PropertiesList';\nexport * from './parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/CircuitSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ConveyorSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/EmptySpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ObjectsListSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/PlayerSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/PowerLineSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/SpecialDroneActionProperties';\nexport * from './parser/satisfactory/types/property/special/SpecialProperties';\nexport * from './parser/satisfactory/types/property/special/VehicleSpecialProperties';\nexport * from './parser/satisfactory/types/structs/col4';\nexport * from './parser/satisfactory/types/structs/DynamicStructPropertyValue';\nexport * from './parser/satisfactory/types/structs/GUID';\nexport * from './parser/satisfactory/types/structs/GUIDInfo';\nexport * from './parser/satisfactory/types/structs/MD5Hash';\nexport * from './parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange';\nexport * from './parser/satisfactory/types/structs/ObjectReference';\nexport * from './parser/satisfactory/types/structs/SoftObjectReference';\nexport * from './parser/satisfactory/types/structs/Transform';\nexport * from './parser/satisfactory/types/structs/vec2';\nexport * from './parser/satisfactory/types/structs/vec3';\nexport * from './parser/satisfactory/types/structs/vec4';\n\n// should better be removed in a future update to prevent shenanigans.\nexport { BlueprintConfigReader, BlueprintReader } from './parser/satisfactory/blueprint/blueprint-reader';\nexport { BlueprintConfigWriter, BlueprintWriter } from './parser/satisfactory/blueprint/blueprint-writer';\nexport { SaveReader } from './parser/satisfactory/save/save-reader';\nexport { SaveWriter } from './parser/satisfactory/save/save-writer';\nexport { SaveStreamJsonStringifier } from './parser/stream/reworked/save-stream-json-stringifier';\nexport { SaveStreamWriter } from './parser/stream/reworked/save-stream-writer.class';\n\n// errors\nexport * from './parser/error/parser.error';\n\n// facade\nexport { Parser } from './parser/parser';\nexport { ReadableStreamParser } from './parser/stream/reworked/readable-stream-parser';\n\n// edit\nexport * from './parser/satisfactory/edit/edit-constants';\n"]}
@@ -6,15 +6,11 @@ export declare class Parser {
6
6
  onDecompressedSaveBody: (buffer: ArrayBuffer) => void;
7
7
  onProgressCallback: (progress: number, msg?: string) => void;
8
8
  }>): SatisfactorySave;
9
- static WriteSave(save: SatisfactorySave, options?: Partial<{
9
+ static WriteSave(save: SatisfactorySave, onHeader: (header: Uint8Array) => void, onChunk: (chunk: Uint8Array) => void, options?: Partial<{
10
10
  onBinaryBeforeCompressing: (buffer: ArrayBuffer) => void;
11
- onHeader: (header: Uint8Array) => void;
12
- onChunk: (chunk: Uint8Array) => void;
13
11
  }>): ChunkSummary[];
14
- static WriteBlueprintFiles(blueprint: Blueprint, options?: Partial<{
12
+ static WriteBlueprintFiles(blueprint: Blueprint, onMainFileHeader: (header: Uint8Array) => void, onMainFileChunk: (chunk: Uint8Array) => void, options?: Partial<{
15
13
  onMainFileBinaryBeforeCompressing: (binary: ArrayBuffer) => void;
16
- onMainFileHeader: (header: Uint8Array) => void;
17
- onMainFileChunk: (chunk: Uint8Array) => void;
18
14
  }>): {
19
15
  mainFileChunkSummary: ChunkSummary[];
20
16
  configFileBinary: ArrayBuffer;
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,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;QACrC,gBAAgB,EAAE,WAAW,CAAA;KAC7B;WAuCa,mBAAmB,CAChC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,MAAM,EAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;QACjB,2BAA2B,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAA;KAC1D,CAAC,GACA,SAAS;IAmCZ,OAAc,qBAAqB,QAAS,GAAG,WAAU,MAAM,KAAO,MAAM,CAQjE;CAEX"}
@@ -32,7 +32,7 @@ class Parser {
32
32
  save.levels = reader.readLevels();
33
33
  return save;
34
34
  }
35
- static WriteSave(save, options) {
35
+ static WriteSave(save, onHeader, onChunk, options) {
36
36
  const writer = new save_writer_1.SaveWriter();
37
37
  save_writer_1.SaveWriter.WriteHeader(writer, save.header);
38
38
  const posAfterHeader = writer.getBufferPosition();
@@ -40,10 +40,10 @@ class Parser {
40
40
  save_writer_1.SaveWriter.WriteGrids(writer, save.grids);
41
41
  save_writer_1.SaveWriter.WriteLevels(writer, save, save.header.buildVersion);
42
42
  writer.endWriting();
43
- const chunkSummary = writer.generateChunks(save.compressionInfo, posAfterHeader, options?.onBinaryBeforeCompressing ?? (() => { }), options?.onHeader ?? (() => { }), options?.onChunk ?? (() => { }));
43
+ const chunkSummary = writer.generateChunks(save.compressionInfo, posAfterHeader, options?.onBinaryBeforeCompressing ?? (() => { }), onHeader, onChunk);
44
44
  return chunkSummary;
45
45
  }
46
- static WriteBlueprintFiles(blueprint, options) {
46
+ static WriteBlueprintFiles(blueprint, onMainFileHeader, onMainFileChunk, options) {
47
47
  const blueprintWriter = new blueprint_writer_1.BlueprintWriter();
48
48
  blueprint_writer_1.BlueprintWriter.SerializeHeader(blueprintWriter, blueprint.header);
49
49
  const saveBodyPos = blueprintWriter.getBufferPosition();
@@ -53,8 +53,8 @@ class Parser {
53
53
  let binaryHeader;
54
54
  const mainFileChunkSummary = blueprintWriter.generateChunks(blueprint.compressionInfo, saveBodyPos, {
55
55
  onBinaryBeforeCompressing: options?.onMainFileBinaryBeforeCompressing ?? (() => { }),
56
- onHeader: options?.onMainFileHeader ?? (() => { }),
57
- onChunk: options?.onMainFileChunk ?? (() => { })
56
+ onHeader: onMainFileHeader,
57
+ onChunk: onMainFileChunk
58
58
  });
59
59
  const configWriter = new blueprint_writer_1.BlueprintConfigWriter();
60
60
  blueprint_writer_1.BlueprintConfigWriter.SerializeConfig(configWriter, blueprint.config);
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAE/D,gFAAmG;AACnG,gFAAmG;AAEnG,6EAAyE;AACzE,iEAA6D;AAC7D,iEAA6D;AAI7D,MAAa,MAAM;IASX,MAAM,CAAC,SAAS,CACtB,IAAY,EACZ,KAAiB,EACjB,OAGE;QAGF,MAAM,MAAM,GAAG,IAAI,wBAAU,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAEzE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,IAAI,oCAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAGhD,MAAM,gBAAgB,GAAG,wBAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;QACnG,IAAI,gBAAgB,KAAK,KAAK,EAAE,CAAC;YAChC,MAAM,IAAI,sCAAuB,CAAC,qCAAqC,CAAC,CAAC;QAC1E,CAAC;aAAM,IAAI,gBAAgB,KAAK,OAAO,EAAE,CAAC;YACzC,MAAM,IAAI,sCAAuB,CAAC,gJAAgJ,CAAC,CAAC;QACrL,CAAC;aAAM,IAAI,gBAAgB,KAAK,IAAI,EAAE,CAAC;YACtC,MAAM,IAAI,sCAAuB,CAAC,4IAA4I,CAAC,CAAC;QACjL,CAAC;QAGD,MAAM,aAA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,MAAM,CAAC,CAAC;QACpG,MAAM,MAAM,GAAG,wCAAqB,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;QAGxE,MAAM,eAAe,GAAG,IAAI,kCAAe,CAAC,IAAI,UAAU,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;QAClF,MAAM,MAAM,GAAG,kCAAe,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;QAC3D,MAAM,aAAa,GAAG,eAAe,CAAC,aAAa,EAAE,CAAC;QAGtD,IAAI,OAAO,EAAE,2BAA2B,KAAK,SAAS,EAAE,CAAC;YACxD,OAAO,CAAC,2BAA2B,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,gBAAgB,GAAG,kCAAe,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;QACvE,MAAM,SAAS,GAAc;YAC5B,IAAI;YACJ,eAAe,EAAE,eAAe,CAAC,eAAe;YAChD,MAAM,EAAE,MAAM;YACd,MAAM;YACN,OAAO,EAAE,gBAAgB;SACzB,CAAC;QACF,OAAO,SAAS,CAAC;IAClB,CAAC;;AA5KF,wBAgMC;AAVc,4BAAqB,GAAG,CAAC,GAAQ,EAAE,SAAiB,CAAC,EAAU,EAAE,CAC9E,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;SAAM,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC,EAAE,MAAM,CAAC,CAAA","sourcesContent":["import { UnsupportedVersionError } from './error/parser.error';\nimport { ChunkSummary } from \"./file.types\";\nimport { BlueprintConfigReader, BlueprintReader } from \"./satisfactory/blueprint/blueprint-reader\";\nimport { BlueprintConfigWriter, BlueprintWriter } from \"./satisfactory/blueprint/blueprint-writer\";\nimport { Blueprint } from \"./satisfactory/blueprint/blueprint.types\";\nimport { SatisfactorySave } from \"./satisfactory/save/satisfactory-save\";\nimport { SaveReader } from './satisfactory/save/save-reader';\nimport { SaveWriter } from \"./satisfactory/save/save-writer\";\n\n\n/** @public */\nexport class Parser {\n\n\t/**\n\t * Parses a given binary buffer as {@link SatisfactorySave}\n\t * @param name the save name. It won't be serialized, so it does not matter how you name it.\n\t * @param bytes the actual binary buffer\n\t * @param options provides callbacks. Either on the decompressed save body or on reported progress as a number [0,1] with an occasional message.\n\t * @returns \n\t */\n\tpublic static ParseSave(\n\t\tname: string,\n\t\tbytes: Uint8Array,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBuffer) => void,\n\t\t\tonProgressCallback: (progress: number, msg?: string) => void\n\t\t}>\n\t): SatisfactorySave {\n\n\t\tconst reader = new SaveReader(bytes.buffer, options?.onProgressCallback);\n\n\t\tconst header = reader.readHeader();\n\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion, header.saveHeaderType);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported.');\n\t\t} else if (roughSaveVersion === 'U6/U7') {\n\t\t\tthrow new UnsupportedVersionError('Game Version U6/U7 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.0.34');\n\t\t} else if (roughSaveVersion === 'U8') {\n\t\t\tthrow new UnsupportedVersionError('Game Version U8 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.3.7');\n\t\t}\n\n\t\t// inflate chunks\n\t\tconst inflateResult = reader.inflateChunks();\n\t\tsave.compressionInfo = reader.compressionInfo;\n\n\t\t// call callback on decompressed save body\n\t\tif (options?.onDecompressedSaveBody !== undefined) {\n\t\t\toptions.onDecompressedSaveBody(reader.getBuffer());\n\t\t}\n\n\t\t// save body validation hash\n\t\tsave.gridHash = reader.readSaveBodyHash();\n\n\t\t// parse grids\n\t\tsave.grids = reader.readGrids();\n\n\t\t// parse levels\n\t\tsave.levels = reader.readLevels();\n\n\t\treturn save;\n\t}\n\n\t/**\n\t * serializes a {@link SatisfactorySave} into binary and reports back on individual callbacks.\n\t * @param save the {@link SatisfactorySave} to serialize into binary.\n\t * @param options provides callbacks. onBinaryBeforeCompressing gets called on the binary save body before it is compressed.\n\t * onHeader gets called on the binary save header, which is always uncompressed.\n\t * onChunk gets called when a chunk of the compressed save body was generated. Often, files' save bodies consist of multiple chunks.\n\t * @returns a summary of the generated chunks.\n\t */\n\tpublic static WriteSave(save: SatisfactorySave,\n\t\toptions?: Partial<{\n\t\t\tonBinaryBeforeCompressing: (buffer: ArrayBuffer) => void,\n\t\t\tonHeader: (header: Uint8Array) => void,\n\t\t\tonChunk: (chunk: Uint8Array) => void\n\t\t}>\n\t): ChunkSummary[] {\n\n\t\tconst writer = new SaveWriter();\n\n\t\tSaveWriter.WriteHeader(writer, save.header);\n\t\tconst posAfterHeader = writer.getBufferPosition();\n\n\t\tSaveWriter.WriteSaveBodyHash(writer, save.gridHash);\n\t\tSaveWriter.WriteGrids(writer, save.grids);\n\t\tSaveWriter.WriteLevels(writer, save, save.header.buildVersion);\n\n\t\twriter.endWriting();\n\t\tconst chunkSummary = writer.generateChunks(save.compressionInfo!, posAfterHeader, options?.onBinaryBeforeCompressing ?? (() => { }), options?.onHeader ?? (() => { }), options?.onChunk ?? (() => { }));\n\t\treturn chunkSummary;\n\t}\n\n\t/**\n\t * Writes a {@link Blueprint} object to binary. And reports back on individual callbacks.\n\t * @param blueprint the blueprint to be written\n\t * @param options onMainFileBinaryBeforeCompressing gets called back when the main blueprint file binary is ready before compressing.\n\t * onMainFileHeader gets called back when the main blueprint file header is ready. onMainFileChunk gets called back when a main blueprint file chunk is ready.\n\t * @returns a chunk summary of the main file generated chunks. Plus the binary data of the config file, since it is often very small.\n\t */\n\tpublic static WriteBlueprintFiles(\n\t\tblueprint: Blueprint,\n\t\toptions?: Partial<{\n\t\t\tonMainFileBinaryBeforeCompressing: (binary: ArrayBuffer) => void,\n\t\t\tonMainFileHeader: (header: Uint8Array) => void,\n\t\t\tonMainFileChunk: (chunk: Uint8Array) => void,\n\t\t}>\n\t): {\n\t\tmainFileChunkSummary: ChunkSummary[],\n\t\tconfigFileBinary: ArrayBuffer\n\t} {\n\n\t\t// write main blueprint file\n\t\tconst blueprintWriter = new BlueprintWriter();\n\t\tBlueprintWriter.SerializeHeader(blueprintWriter, blueprint.header);\n\t\tconst saveBodyPos = blueprintWriter.getBufferPosition();\n\t\tBlueprintWriter.SerializeObjects(blueprintWriter, blueprint.objects);\n\t\tblueprintWriter.endWriting();\n\t\tlet binaryChunks: Uint8Array[] = [];\n\t\tlet binaryHeader: Uint8Array;\n\t\tconst mainFileChunkSummary = blueprintWriter.generateChunks(\n\t\t\tblueprint.compressionInfo,\n\t\t\tsaveBodyPos,\n\t\t\t{\n\t\t\t\tonBinaryBeforeCompressing: options?.onMainFileBinaryBeforeCompressing ?? (() => { }),\n\t\t\t\tonHeader: options?.onMainFileHeader ?? (() => { }),\n\t\t\t\tonChunk: options?.onMainFileChunk ?? (() => { })\n\t\t\t}\n\t\t);\n\n\t\t// write config as well.\n\t\tconst configWriter = new BlueprintConfigWriter();\n\t\tBlueprintConfigWriter.SerializeConfig(configWriter, blueprint.config);\n\t\tconst configFileBinary = configWriter.endWriting();\n\n\t\treturn {\n\t\t\tmainFileChunkSummary,\n\t\t\tconfigFileBinary\n\t\t}\n\t}\n\n\t/**\n\t * Parses two buffers (main blueprint file + config file) into a {@link Blueprint object}\n\t * @param name the name of the blueprint, since it is not part of the binary data and has to be passed.\n\t * @param blueprintFile the main blueprint file \".sbp\"\n\t * @param blueprintConfigFile the config blueprint file \".sbpcfg\"\n\t * @param options provides callbacks. onDecompressedBlueprintBody gets called when the body of the main blueprint file is decompressed.\n\t * @returns \n\t */\n\tpublic static ParseBlueprintFiles(\n\t\tname: string,\n\t\tblueprintFile: Buffer,\n\t\tblueprintConfigFile: Buffer,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedBlueprintBody: (buffer: ArrayBuffer) => void\n\t\t}>\n\t): Blueprint {\n\n\t\t// read config file\n\t\tconst blueprintConfigReader = new BlueprintConfigReader(new Uint8Array(blueprintConfigFile).buffer);\n\t\tconst config = BlueprintConfigReader.ParseConfig(blueprintConfigReader);\n\n\t\t// read actual blueprint file\n\t\tconst blueprintReader = new BlueprintReader(new Uint8Array(blueprintFile).buffer);\n\t\tconst header = BlueprintReader.ReadHeader(blueprintReader);\n\t\tconst inflateResult = blueprintReader.inflateChunks();\n\n\t\t// call back on decompressed body.\n\t\tif (options?.onDecompressedBlueprintBody !== undefined) {\n\t\t\toptions.onDecompressedBlueprintBody(inflateResult.inflatedData);\n\t\t}\n\n\t\tconst blueprintObjects = BlueprintReader.ParseObjects(blueprintReader);\n\t\tconst blueprint: Blueprint = {\n\t\t\tname,\n\t\t\tcompressionInfo: blueprintReader.compressionInfo,\n\t\t\theader: header,\n\t\t\tconfig,\n\t\t\tobjects: blueprintObjects\n\t\t};\n\t\treturn blueprint;\n\t}\n\n\t/**\n\t * It JSON.stringifies any parsed content safely. The original JSON.stringify() has some flaws that get in the way, so it is custom wrapped. The original has some problems:\n\t * 1. it cannot stringify bigints. So we help out by converting it into a string.\n\t * 2. It cannot distinguish between 0 and -0. But a float32 is encoded in a uint8Array for 0 to be [0,0,0,0] (0x00000000) and -0 to be [0,0,0,128] (0x00000080) in little endian.\n\t * @param obj basically anything that can be stringified\n\t * @param indent the indentation, just like with the real JSON stringify.\n\t * @returns a string that is safely stringified.\n\t */\n\tpublic static JSONStringifyModified = (obj: any, indent: number = 0): string =>\n\t\tJSON.stringify(obj, (key, value) => {\n\t\t\tif (typeof value === 'bigint') {\n\t\t\t\treturn value.toString();\n\t\t\t} else if (value === 0 && 1 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,CAAC,2BAA2B,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,gBAAgB,GAAG,kCAAe,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;QACvE,MAAM,SAAS,GAAc;YAC5B,IAAI;YACJ,eAAe,EAAE,eAAe,CAAC,eAAe;YAChD,MAAM,EAAE,MAAM;YACd,MAAM;YACN,OAAO,EAAE,gBAAgB;SACzB,CAAC;QACF,OAAO,SAAS,CAAC;IAClB,CAAC;;AA5KF,wBAgMC;AAVc,4BAAqB,GAAG,CAAC,GAAQ,EAAE,SAAiB,CAAC,EAAU,EAAE,CAC9E,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;SAAM,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC,EAAE,MAAM,CAAC,CAAA","sourcesContent":["import { UnsupportedVersionError } from './error/parser.error';\nimport { ChunkSummary } from \"./file.types\";\nimport { BlueprintConfigReader, BlueprintReader } from \"./satisfactory/blueprint/blueprint-reader\";\nimport { BlueprintConfigWriter, BlueprintWriter } from \"./satisfactory/blueprint/blueprint-writer\";\nimport { Blueprint } from \"./satisfactory/blueprint/blueprint.types\";\nimport { SatisfactorySave } from \"./satisfactory/save/satisfactory-save\";\nimport { SaveReader } from './satisfactory/save/save-reader';\nimport { SaveWriter } from \"./satisfactory/save/save-writer\";\n\n\n/** @public */\nexport class Parser {\n\n\t/**\n\t * Parses a given binary buffer as {@link SatisfactorySave}\n\t * @param name the save name. It won't be serialized, so it does not matter how you name it.\n\t * @param bytes the actual binary buffer\n\t * @param options provides callbacks. Either on the decompressed save body or on reported progress as a number [0,1] with an occasional message.\n\t * @returns \n\t */\n\tpublic static ParseSave(\n\t\tname: string,\n\t\tbytes: Uint8Array,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBuffer) => void,\n\t\t\tonProgressCallback: (progress: number, msg?: string) => void\n\t\t}>\n\t): SatisfactorySave {\n\n\t\tconst reader = new SaveReader(bytes.buffer, options?.onProgressCallback);\n\n\t\tconst header = reader.readHeader();\n\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion, header.saveHeaderType);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported.');\n\t\t} else if (roughSaveVersion === 'U6/U7') {\n\t\t\tthrow new UnsupportedVersionError('Game Version U6/U7 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.0.34');\n\t\t} else if (roughSaveVersion === 'U8') {\n\t\t\tthrow new UnsupportedVersionError('Game Version U8 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.3.7');\n\t\t}\n\n\t\t// inflate chunks\n\t\tconst inflateResult = reader.inflateChunks();\n\t\tsave.compressionInfo = reader.compressionInfo;\n\n\t\t// call callback on decompressed save body\n\t\tif (options?.onDecompressedSaveBody !== undefined) {\n\t\t\toptions.onDecompressedSaveBody(reader.getBuffer());\n\t\t}\n\n\t\t// save body validation hash\n\t\tsave.gridHash = reader.readSaveBodyHash();\n\n\t\t// parse grids\n\t\tsave.grids = reader.readGrids();\n\n\t\t// parse levels\n\t\tsave.levels = reader.readLevels();\n\n\t\treturn save;\n\t}\n\n\t/**\n\t * serializes a {@link SatisfactorySave} into binary and reports back on individual callbacks.\n\t * @param save the {@link SatisfactorySave} to serialize into binary.\n\t * @param options provides callbacks. onBinaryBeforeCompressing gets called on the binary save body before it is compressed.\n\t * onHeader gets called on the binary save header, which is always uncompressed.\n\t * onChunk gets called when a chunk of the compressed save body was generated. Often, files' save bodies consist of multiple chunks.\n\t * @returns a summary of the generated chunks.\n\t */\n\tpublic static WriteSave(save: SatisfactorySave,\n\t\tonHeader: (header: Uint8Array) => void,\n\t\tonChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonBinaryBeforeCompressing: (buffer: ArrayBuffer) => void,\n\t\t}>\n\t): ChunkSummary[] {\n\n\t\tconst writer = new SaveWriter();\n\n\t\tSaveWriter.WriteHeader(writer, save.header);\n\t\tconst posAfterHeader = writer.getBufferPosition();\n\n\t\tSaveWriter.WriteSaveBodyHash(writer, save.gridHash);\n\t\tSaveWriter.WriteGrids(writer, save.grids);\n\t\tSaveWriter.WriteLevels(writer, save, save.header.buildVersion);\n\n\t\twriter.endWriting();\n\t\tconst chunkSummary = writer.generateChunks(save.compressionInfo!, posAfterHeader, options?.onBinaryBeforeCompressing ?? (() => { }), onHeader, onChunk);\n\t\treturn chunkSummary;\n\t}\n\n\t/**\n\t * Writes a {@link Blueprint} object to binary. And reports back on individual callbacks.\n\t * @param blueprint the blueprint to be written\n\t * @param options onMainFileBinaryBeforeCompressing gets called back when the main blueprint file binary is ready before compressing.\n\t * onMainFileHeader gets called back when the main blueprint file header is ready. onMainFileChunk gets called back when a main blueprint file chunk is ready.\n\t * @returns a chunk summary of the main file generated chunks. Plus the binary data of the config file, since it is often very small.\n\t */\n\tpublic static WriteBlueprintFiles(\n\t\tblueprint: Blueprint,\n\t\tonMainFileHeader: (header: Uint8Array) => void,\n\t\tonMainFileChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonMainFileBinaryBeforeCompressing: (binary: ArrayBuffer) => void,\n\t\t}>\n\t): {\n\t\tmainFileChunkSummary: ChunkSummary[],\n\t\tconfigFileBinary: ArrayBuffer\n\t} {\n\n\t\t// write main blueprint file\n\t\tconst blueprintWriter = new BlueprintWriter();\n\t\tBlueprintWriter.SerializeHeader(blueprintWriter, blueprint.header);\n\t\tconst saveBodyPos = blueprintWriter.getBufferPosition();\n\t\tBlueprintWriter.SerializeObjects(blueprintWriter, blueprint.objects);\n\t\tblueprintWriter.endWriting();\n\t\tlet binaryChunks: Uint8Array[] = [];\n\t\tlet binaryHeader: Uint8Array;\n\t\tconst mainFileChunkSummary = blueprintWriter.generateChunks(\n\t\t\tblueprint.compressionInfo,\n\t\t\tsaveBodyPos,\n\t\t\t{\n\t\t\t\tonBinaryBeforeCompressing: options?.onMainFileBinaryBeforeCompressing ?? (() => { }),\n\t\t\t\tonHeader: onMainFileHeader,\n\t\t\t\tonChunk: onMainFileChunk\n\t\t\t}\n\t\t);\n\n\t\t// write config as well.\n\t\tconst configWriter = new BlueprintConfigWriter();\n\t\tBlueprintConfigWriter.SerializeConfig(configWriter, blueprint.config);\n\t\tconst configFileBinary = configWriter.endWriting();\n\n\t\treturn {\n\t\t\tmainFileChunkSummary,\n\t\t\tconfigFileBinary\n\t\t}\n\t}\n\n\t/**\n\t * Parses two buffers (main blueprint file + config file) into a {@link Blueprint object}\n\t * @param name the name of the blueprint, since it is not part of the binary data and has to be passed.\n\t * @param blueprintFile the main blueprint file \".sbp\"\n\t * @param blueprintConfigFile the config blueprint file \".sbpcfg\"\n\t * @param options provides callbacks. onDecompressedBlueprintBody gets called when the body of the main blueprint file is decompressed.\n\t * @returns \n\t */\n\tpublic static ParseBlueprintFiles(\n\t\tname: string,\n\t\tblueprintFile: Buffer,\n\t\tblueprintConfigFile: Buffer,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedBlueprintBody: (buffer: ArrayBuffer) => void\n\t\t}>\n\t): Blueprint {\n\n\t\t// read config file\n\t\tconst blueprintConfigReader = new BlueprintConfigReader(new Uint8Array(blueprintConfigFile).buffer);\n\t\tconst config = BlueprintConfigReader.ParseConfig(blueprintConfigReader);\n\n\t\t// read actual blueprint file\n\t\tconst blueprintReader = new BlueprintReader(new Uint8Array(blueprintFile).buffer);\n\t\tconst header = BlueprintReader.ReadHeader(blueprintReader);\n\t\tconst inflateResult = blueprintReader.inflateChunks();\n\n\t\t// call back on decompressed body.\n\t\tif (options?.onDecompressedBlueprintBody !== undefined) {\n\t\t\toptions.onDecompressedBlueprintBody(inflateResult.inflatedData);\n\t\t}\n\n\t\tconst blueprintObjects = BlueprintReader.ParseObjects(blueprintReader);\n\t\tconst blueprint: Blueprint = {\n\t\t\tname,\n\t\t\tcompressionInfo: blueprintReader.compressionInfo,\n\t\t\theader: header,\n\t\t\tconfig,\n\t\t\tobjects: blueprintObjects\n\t\t};\n\t\treturn blueprint;\n\t}\n\n\t/**\n\t * It JSON.stringifies any parsed content safely. The original JSON.stringify() has some flaws that get in the way, so it is custom wrapped. The original has some problems:\n\t * 1. it cannot stringify bigints. So we help out by converting it into a string.\n\t * 2. It cannot distinguish between 0 and -0. But a float32 is encoded in a uint8Array for 0 to be [0,0,0,0] (0x00000000) and -0 to be [0,0,0,128] (0x00000080) in little endian.\n\t * @param obj basically anything that can be stringified\n\t * @param indent the indentation, just like with the real JSON stringify.\n\t * @returns a string that is safely stringified.\n\t */\n\tpublic static JSONStringifyModified = (obj: any, indent: number = 0): string =>\n\t\tJSON.stringify(obj, (key, value) => {\n\t\t\tif (typeof value === 'bigint') {\n\t\t\t\treturn value.toString();\n\t\t\t} else if (value === 0 && 1 / value < 0) {\t// -0\n\t\t\t\treturn '-0';\n\t\t\t}\n\t\t\treturn value;\n\t\t}, indent)\n\n}"]}
@@ -1,8 +1,8 @@
1
1
  import { BinaryReadable } from '../../byte/binary-readable.interface';
2
- import { ByteWriter } from '../../byte/byte-writer.class';
2
+ import { BinaryWritable } from '../../byte/binary-writable.interface';
3
3
  import { ObjectReference } from '../types/structs/ObjectReference';
4
4
  export declare namespace ObjectReferencesList {
5
- const SerializeList: (writer: ByteWriter, collectables: ObjectReference[]) => void;
5
+ const SerializeList: (writer: BinaryWritable, collectables: ObjectReference[]) => void;
6
6
  const ReadList: (reader: BinaryReadable) => ObjectReference[];
7
7
  }
8
8
  //# sourceMappingURL=object-references-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"object-references-list.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/object-references-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,yBAAiB,oBAAoB,CAAC;IAE3B,MAAM,aAAa,WAAY,UAAU,gBAAgB,eAAe,EAAE,KAAG,IAKnF,CAAA;IAEM,MAAM,QAAQ,WAAY,cAAc,KAAG,eAAe,EAOhE,CAAA;CACJ"}
1
+ {"version":3,"file":"object-references-list.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/object-references-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAEnE,yBAAiB,oBAAoB,CAAC;IAE3B,MAAM,aAAa,WAAY,cAAc,gBAAgB,eAAe,EAAE,KAAG,IAKvF,CAAA;IAEM,MAAM,QAAQ,WAAY,cAAc,KAAG,eAAe,EAOhE,CAAA;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"object-references-list.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/object-references-list.ts"],"names":[],"mappings":";;;AAEA,sEAAmE;AAEnE,IAAiB,oBAAoB,CAiBpC;AAjBD,WAAiB,oBAAoB;IAEpB,kCAAa,GAAG,CAAC,MAAkB,EAAE,YAA+B,EAAQ,EAAE;QACvF,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACvC,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;YACrC,iCAAe,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC,CAAA;IAEY,6BAAQ,GAAG,CAAC,MAAsB,EAAqB,EAAE;QAClE,MAAM,SAAS,GAAsB,EAAE,CAAC;QACxC,IAAI,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,iCAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC,CAAA;AACL,CAAC,EAjBgB,oBAAoB,oCAApB,oBAAoB,QAiBpC","sourcesContent":["import { BinaryReadable } from '../../byte/binary-readable.interface';\r\nimport { ByteWriter } from '../../byte/byte-writer.class';\r\nimport { ObjectReference } from '../types/structs/ObjectReference';\r\n\r\nexport namespace ObjectReferencesList {\r\n\r\n export const SerializeList = (writer: ByteWriter, collectables: ObjectReference[]): void => {\r\n writer.writeInt32(collectables.length);\r\n for (const collectable of collectables) {\r\n ObjectReference.write(writer, collectable);\r\n }\r\n }\r\n\r\n export const ReadList = (reader: BinaryReadable): ObjectReference[] => {\r\n const collected: ObjectReference[] = [];\r\n let count = reader.readInt32();\r\n for (let i = 0; i < count; i++) {\r\n collected.push(ObjectReference.read(reader));\r\n }\r\n return collected;\r\n }\r\n}"]}
1
+ {"version":3,"file":"object-references-list.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/object-references-list.ts"],"names":[],"mappings":";;;AAEA,sEAAmE;AAEnE,IAAiB,oBAAoB,CAiBpC;AAjBD,WAAiB,oBAAoB;IAEpB,kCAAa,GAAG,CAAC,MAAsB,EAAE,YAA+B,EAAQ,EAAE;QAC3F,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACvC,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;YACrC,iCAAe,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAC/C,CAAC;IACL,CAAC,CAAA;IAEY,6BAAQ,GAAG,CAAC,MAAsB,EAAqB,EAAE;QAClE,MAAM,SAAS,GAAsB,EAAE,CAAC;QACxC,IAAI,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QAC/B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;YAC7B,SAAS,CAAC,IAAI,CAAC,iCAAe,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC,CAAA;AACL,CAAC,EAjBgB,oBAAoB,oCAApB,oBAAoB,QAiBpC","sourcesContent":["import { BinaryReadable } from '../../byte/binary-readable.interface';\r\nimport { BinaryWritable } from '../../byte/binary-writable.interface';\r\nimport { ObjectReference } from '../types/structs/ObjectReference';\r\n\r\nexport namespace ObjectReferencesList {\r\n\r\n export const SerializeList = (writer: BinaryWritable, collectables: ObjectReference[]): void => {\r\n writer.writeInt32(collectables.length);\r\n for (const collectable of collectables) {\r\n ObjectReference.write(writer, collectable);\r\n }\r\n }\r\n\r\n export const ReadList = (reader: BinaryReadable): ObjectReference[] => {\r\n const collected: ObjectReference[] = [];\r\n let count = reader.readInt32();\r\n for (let i = 0; i < count; i++) {\r\n collected.push(ObjectReference.read(reader));\r\n }\r\n return collected;\r\n }\r\n}"]}
@@ -1,7 +1,7 @@
1
1
  import { BinaryReadable } from "../../../byte/binary-readable.interface";
2
2
  import { ByteWriter } from "../../../byte/byte-writer.class";
3
3
  import { PropertiesMap } from "../property/generic/BasicProperty";
4
- import { SpecialAnyProperties } from '../property/special/SpecialAnyProperties';
4
+ import { SpecialProperties } from '../property/special/SpecialProperties';
5
5
  export interface SaveObjectHeader {
6
6
  typePath: string;
7
7
  rootObject: string;
@@ -12,7 +12,7 @@ export declare abstract class SaveObject implements SaveObjectHeader {
12
12
  rootObject: string;
13
13
  instanceName: string;
14
14
  properties: PropertiesMap;
15
- specialProperties: SpecialAnyProperties;
15
+ specialProperties: SpecialProperties.AvailableSpecialPropertiesTypes;
16
16
  trailingData: number[];
17
17
  objectVersion: number;
18
18
  unknownType2: number;
@@ -1 +1 @@
1
- {"version":3,"file":"SaveObject.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/objects/SaveObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG7D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAGhF,MAAM,WAAW,gBAAgB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,8BAAsB,UAAW,YAAW,gBAAgB;IASxC,QAAQ,EAAE,MAAM;IAAS,UAAU,EAAE,MAAM;IAAS,YAAY,EAAE,MAAM;IAPpF,UAAU,EAAE,aAAa,CAAM;IAC/B,iBAAiB,EAAE,oBAAoB,CAAM;IAC7C,YAAY,EAAE,MAAM,EAAE,CAAM;IAE5B,aAAa,EAAE,MAAM,CAAK;IAC1B,YAAY,EAAE,MAAM,CAAK;gBAEb,QAAQ,EAAE,MAAM,EAAS,UAAU,EAAE,MAAM,EAAS,YAAY,EAAE,MAAM;IAI3F,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI;IAM3E,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAAG,IAAI;WAM7D,SAAS,CAAC,GAAG,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM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AAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;WAkBhH,aAAa,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;CAMrF"}
@@ -10,7 +10,7 @@ class SaveObject {
10
10
  this.rootObject = rootObject;
11
11
  this.instanceName = instanceName;
12
12
  this.properties = {};
13
- this.specialProperties = {};
13
+ this.specialProperties = { type: 'EmptySpecialProperties' };
14
14
  this.trailingData = [];
15
15
  this.objectVersion = 0;
16
16
  this.unknownType2 = 0;
@@ -27,7 +27,7 @@ class SaveObject {
27
27
  }
28
28
  static ParseData(obj, length, reader, buildVersion, typePath) {
29
29
  const start = reader.getBufferPosition();
30
- PropertiesList_1.PropertiesList.ParseList(obj, length, reader, buildVersion, typePath);
30
+ obj.properties = PropertiesList_1.PropertiesList.ParseList(reader, buildVersion);
31
31
  reader.readInt32();
32
32
  let remainingSize = length - (reader.getBufferPosition() - start);
33
33
  obj.specialProperties = SpecialProperties_1.SpecialProperties.ParseClassSpecificSpecialProperties(reader, typePath, remainingSize);
@@ -40,7 +40,7 @@ class SaveObject {
40
40
  }
41
41
  }
42
42
  static SerializeData(writer, obj, buildVersion) {
43
- PropertiesList_1.PropertiesList.SerializeList(obj, writer, buildVersion, obj.typePath);
43
+ PropertiesList_1.PropertiesList.SerializeList(obj.properties, writer, buildVersion);
44
44
  writer.writeInt32(0);
45
45
  SpecialProperties_1.SpecialProperties.SerializeClassSpecificSpecialProperties(writer, obj.typePath, obj.specialProperties);
46
46
  writer.writeBytesArray(obj.trailingData);
@@ -1 +1 @@
1
- {"version":3,"file":"SaveObject.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/objects/SaveObject.ts"],"names":[],"mappings":";;;AAEA,8DAA0D;AAC1D,+DAA4D;AAG5D,6EAA0E;AAQ1E,MAAsB,UAAU;IAS/B,YAAmB,QA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AM,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;QAE/G,aAAa,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,iBAAiB,EAAE,GAAG,KAAK,CAAC,CAAC;QAC9D,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YACvB,GAAG,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;QAChE,CAAC;aAAM,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,0BAAW,CAAC,aAAa,EAAE,6DAA6D,GAAG,CAAC,YAAY,2BAA2B,aAAa,EAAE,CAAC,CAAC;QAC/J,CAAC;IACF,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,MAAW,EAAE,GAAe,EAAE,YAAoB;QAC7E,+BAAc,CAAC,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;QACtE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACrB,qCAAiB,CAAC,uCAAuC,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACvG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;CACD;AAjDD,gCAiDC","sourcesContent":["import { BinaryReadable } from \"../../../byte/binary-readable.interface\";\nimport { ByteWriter } from \"../../../byte/byte-writer.class\";\nimport { ParserError } from '../../../error/parser.error';\nimport { PropertiesList } from '../property/PropertiesList';\nimport { PropertiesMap } from \"../property/generic/BasicProperty\";\nimport { SpecialAnyProperties } from '../property/special/SpecialAnyProperties';\nimport { SpecialProperties } from '../property/special/SpecialProperties';\n\nexport interface SaveObjectHeader {\n\ttypePath: string;\n\trootObject: string;\n\tinstanceName: string;\n}\n\nexport abstract class SaveObject implements SaveObjectHeader {\n\n\tpublic properties: PropertiesMap = {};\n\tpublic specialProperties: SpecialAnyProperties = {};\n\tpublic trailingData: number[] = [];\n\n\tpublic objectVersion: number = 0;\n\tpublic unknownType2: number = 0;\n\n\tconstructor(public typePath: string, public rootObject: string, public instanceName: string) {\n\n\t}\n\n\tprotected static ParseHeader(reader: BinaryReadable, obj: SaveObject): void {\n\t\tobj.typePath = reader.readString();\n\t\tobj.rootObject = reader.readString();\n\t\tobj.instanceName = reader.readString();\n\t}\n\n\tprotected static SerializeHeader(writer: ByteWriter, obj: SaveObject): void {\n\t\twriter.writeString(obj.typePath);\n\t\twriter.writeString(obj.rootObject);\n\t\twriter.writeString(obj.instanceName);\n\t}\n\n\tpublic static ParseData(obj: SaveObject, length: number, reader: BinaryReadable, buildVersion: number, typePath: string): void {\n\t\tconst start = reader.getBufferPosition();\n\n\t\tPropertiesList.ParseList(obj, length, reader, buildVersion, typePath);\n\n\t\treader.readInt32(); // 0\n\n\t\tlet remainingSize = length - (reader.getBufferPosition() - start);\n\t\tobj.specialProperties = SpecialProperties.ParseClassSpecificSpecialProperties(reader, typePath, remainingSize);\n\n\t\tremainingSize = length - (reader.getBufferPosition() - start);\n\t\tif (remainingSize > 0) {\n\t\t\tobj.trailingData = Array.from(reader.readBytes(remainingSize));\n\t\t} else if (remainingSize < 0) {\n\t\t\tthrow new ParserError('ParserError', `Unexpected. Read more bytes than are indicated for entity ${obj.instanceName}. bytes left to read is ${remainingSize}`);\n\t\t}\n\t}\n\n\tpublic static SerializeData(writer: any, obj: SaveObject, buildVersion: number): void {\n\t\tPropertiesList.SerializeList(obj, writer, buildVersion, obj.typePath);\n\t\twriter.writeInt32(0);\n\t\tSpecialProperties.SerializeClassSpecificSpecialProperties(writer, obj.typePath, obj.specialProperties);\n\t\twriter.writeBytesArray(obj.trailingData);\n\t}\n}"]}
1
+ {"version":3,"file":"SaveObject.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/objects/SaveObject.ts"],"names":[],"mappings":";;;AAEA,8DAA0D;AAE1D,+DA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C,CAAC;QAClE,GAAG,CAAC,iBAAiB,GAAG,qCAAiB,CAAC,mCAAmC,CAAC,MAAM,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAC;QAE/G,aAAa,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,iBAAiB,EAAE,GAAG,KAAK,CAAC,CAAC;QAC9D,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YACvB,GAAG,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC;QAChE,CAAC;aAAM,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,0BAAW,CAAC,aAAa,EAAE,6DAA6D,GAAG,CAAC,YAAY,2BAA2B,aAAa,EAAE,CAAC,CAAC;QAC/J,CAAC;IACF,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,MAAW,EAAE,GAAe,EAAE,YAAoB;QAC7E,+BAAc,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACnE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACrB,qCAAiB,CAAC,uCAAuC,CAAC,MAAM,EAAE,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACvG,MAAM,CAAC,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;CACD;AAjDD,gCAiDC","sourcesContent":["import { BinaryReadable } from \"../../../byte/binary-readable.interface\";\nimport { ByteWriter } from \"../../../byte/byte-writer.class\";\nimport { ParserError } from '../../../error/parser.error';\nimport { PropertiesMap } from \"../property/generic/BasicProperty\";\nimport { PropertiesList } from '../property/PropertiesList';\nimport { SpecialProperties } from '../property/special/SpecialProperties';\n\nexport interface SaveObjectHeader {\n\ttypePath: string;\n\trootObject: string;\n\tinstanceName: string;\n}\n\nexport abstract class SaveObject implements SaveObjectHeader {\n\n\tpublic properties: PropertiesMap = {};\n\tpublic specialProperties: SpecialProperties.AvailableSpecialPropertiesTypes = { type: 'EmptySpecialProperties' };\n\tpublic trailingData: number[] = [];\n\n\tpublic objectVersion: number = 0;\n\tpublic unknownType2: number = 0;\n\n\tconstructor(public typePath: string, public rootObject: string, public instanceName: string) {\n\n\t}\n\n\tprotected static ParseHeader(reader: BinaryReadable, obj: SaveObject): void {\n\t\tobj.typePath = reader.readString();\n\t\tobj.rootObject = reader.readString();\n\t\tobj.instanceName = reader.readString();\n\t}\n\n\tprotected static SerializeHeader(writer: ByteWriter, obj: SaveObject): void {\n\t\twriter.writeString(obj.typePath);\n\t\twriter.writeString(obj.rootObject);\n\t\twriter.writeString(obj.instanceName);\n\t}\n\n\tpublic static ParseData(obj: SaveObject, length: number, reader: BinaryReadable, buildVersion: number, typePath: string): void {\n\t\tconst start = reader.getBufferPosition();\n\n\t\tobj.properties = PropertiesList.ParseList(reader, buildVersion);\n\n\t\treader.readInt32(); // 0\n\n\t\tlet remainingSize = length - (reader.getBufferPosition() - start);\n\t\tobj.specialProperties = SpecialProperties.ParseClassSpecificSpecialProperties(reader, typePath, remainingSize);\n\n\t\tremainingSize = length - (reader.getBufferPosition() - start);\n\t\tif (remainingSize > 0) {\n\t\t\tobj.trailingData = Array.from(reader.readBytes(remainingSize));\n\t\t} else if (remainingSize < 0) {\n\t\t\tthrow new ParserError('ParserError', `Unexpected. Read more bytes than are indicated for entity ${obj.instanceName}. bytes left to read is ${remainingSize}`);\n\t\t}\n\t}\n\n\tpublic static SerializeData(writer: any, obj: SaveObject, buildVersion: number): void {\n\t\tPropertiesList.SerializeList(obj.properties, writer, buildVersion);\n\t\twriter.writeInt32(0);\n\t\tSpecialProperties.SerializeClassSpecificSpecialProperties(writer, obj.typePath, obj.specialProperties);\n\t\twriter.writeBytesArray(obj.trailingData);\n\t}\n}"]}
@@ -1,11 +1,9 @@
1
1
  import { BinaryReadable } from '../../../byte/binary-readable.interface';
2
2
  import { ByteWriter } from '../../../byte/byte-writer.class';
3
- import { SaveWriter } from '../../save/save-writer';
4
- import { SaveObject } from '../objects/SaveObject';
5
- import { AbstractBaseProperty } from './generic/BasicProperty';
3
+ import { AbstractBaseProperty, PropertiesMap } from './generic/BasicProperty';
6
4
  export declare namespace PropertiesList {
7
- const ParseList: (obj: SaveObject, length: number, reader: BinaryReadable, buildVersion: number, typePath: string) => void;
8
- const SerializeList: (obj: SaveObject, writer: SaveWriter, buildVersion: number, typePath: string) => void;
5
+ const ParseList: (reader: BinaryReadable, buildVersion: number) => PropertiesMap;
6
+ const SerializeList: (properties: PropertiesMap, writer: ByteWriter, buildVersion: number) => void;
9
7
  const ParseSingleProperty: (reader: BinaryReadable, buildVersion: number, propertyName: string) => AbstractBaseProperty;
10
8
  const SerializeSingleProperty: (writer: ByteWriter, property: AbstractBaseProperty, propertyName: string, buildVersion: number) => void;
11
9
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PropertiesList.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/property/PropertiesList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAqB/D,yBAAiB,cAAc,CAAC;IAExB,MAAM,SAAS,QAAS,UAAU,UAAU,MAAM,UAAU,cAAc,gBAAgB,MAAM,YAAY,MAAM,KAAG,IAyB3H,CAAA;IAEM,MAAM,aAAa,QAAS,UAAU,UAAU,UAAU,gBAAgB,MAAM,YAAY,MAAM,KAAG,IAM3G,CAAA;IAEM,MAAM,mBAAmB,WAAY,cAAc,gBAAgB,MAAM,gBAAgB,MAAM,KAAG,oBA4HxG,CAAA;IAEM,MAAM,uBAAuB,WAAY,UAAU,YAAY,oBAAoB,gBAAgB,MAAM,gBAAgB,MAAM,KAAG,IA4HxI,CAAA;CACD"}
1
+ {"version":3,"file":"PropertiesList.d.ts","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/property/PropertiesList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG7D,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAqB9E,yBAAiB,cAAc,CAAC;IAExB,MAAM,SAAS,WAAY,cAAc,gBAAgB,MAAM,KAAG,aAqBxE,CAAA;IAEM,MAAM,aAAa,eAAgB,aAAa,UAAU,UAAU,gBAAgB,MAAM,KAAG,IAMnG,CAAA;IAEM,MAAM,mBAAmB,WAAY,cAAc,gBAAgB,MAAM,gBAAgB,MAAM,KAAG,oBA4HxG,CAAA;IAEM,MAAM,uBAAuB,WAAY,UAAU,YAAY,oBAAoB,gBAAgB,MAAM,gBAAgB,MAAM,KAAG,IA4HxI,CAAA;CACD"}
@@ -23,29 +23,26 @@ const Uint64Property_1 = require("./generic/Uint64Property");
23
23
  const Uint8Property_1 = require("./generic/Uint8Property");
24
24
  var PropertiesList;
25
25
  (function (PropertiesList) {
26
- PropertiesList.ParseList = (obj, length, reader, buildVersion, typePath) => {
27
- obj.properties = {};
28
- if (length === 0) {
29
- console.warn(`properties length for object ${obj.instanceName} was indicated as 0. Which is suspicious. Skipping object properties.`);
30
- return;
31
- }
26
+ PropertiesList.ParseList = (reader, buildVersion) => {
27
+ const properties = {};
32
28
  let propertyName = reader.readString();
33
29
  while (propertyName !== 'None') {
34
30
  const parsedProperty = PropertiesList.ParseSingleProperty(reader, buildVersion, propertyName);
35
- if (obj.properties[propertyName]) {
36
- if (!Array.isArray(obj.properties[propertyName])) {
37
- obj.properties[propertyName] = [obj.properties[propertyName]];
31
+ if (properties[propertyName]) {
32
+ if (!Array.isArray(properties[propertyName])) {
33
+ properties[propertyName] = [properties[propertyName]];
38
34
  }
39
- obj.properties[propertyName].push(parsedProperty);
35
+ properties[propertyName].push(parsedProperty);
40
36
  }
41
37
  else {
42
- obj.properties[propertyName] = parsedProperty;
38
+ properties[propertyName] = parsedProperty;
43
39
  }
44
40
  propertyName = reader.readString();
45
41
  }
42
+ return properties;
46
43
  };
47
- PropertiesList.SerializeList = (obj, writer, buildVersion, typePath) => {
48
- for (const property of Object.values(obj.properties).flatMap(val => Array.isArray(val) ? val : [val])) {
44
+ PropertiesList.SerializeList = (properties, writer, buildVersion) => {
45
+ for (const property of Object.values(properties).flatMap(val => Array.isArray(val) ? val : [val])) {
49
46
  writer.writeString(property.name);
50
47
  PropertiesList.SerializeSingleProperty(writer, property, property.name, buildVersion);
51
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"PropertiesList.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/property/PropertiesList.ts"],"names":[],"mappings":";;;AAEA,8DAA0D;AAG1D,2DAAwD;AAExD,yDAAsD;AACtD,yDAAsD;AACtD,6DAA0D;AAC1D,yDAAsD;AACtD,2DAAwD;AACxD,2DAAwD;AACxD,2DAAwD;AACxD,yDAAsD;AACtD,uDAAoD;AACpD,6DAA0D;AAC1D,uDAAoD;AACpD,qEAAkE;AAClE,uDAAoD;AACpD,6DAA0D;AAC1D,yDAAsD;AACtD,6DAA0D;AAC1D,6DAA0D;AAC1D,2DAAwD;AAGxD,IAAiB,cAAc,CAgS9B;AAhSD,WAAiB,cAAc;IAEjB,wBAAS,GAAG,CAAC,GAAe,EAAE,MAAc,EAAE,MAAsB,EAAE,YAAoB,EAAE,QAAgB,EAAQ,EAAE;QAElI,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC;QACpB,IAAI,MAAM,KAAK,CAAC,EAAE,CAAC;YAClB,OAAO,CAAC,IAAI,CAAC,gCAAgC,GAAG,CAAC,YAAY,uEAAuE,CAAC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":["import { BinaryReadable } from '../../../byte/binary-readable.interface';\nimport { ByteWriter } from '../../../byte/byte-writer.class';\nimport { ParserError } from '../../../error/parser.error';\nimport { SaveWriter } from '../../save/save-writer';\nimport { SaveObject } from '../objects/SaveObject';\nimport { ArrayProperty } from './generic/ArrayProperty';\nimport { AbstractBaseProperty } from './generic/BasicProperty';\nimport { BoolProperty } from './generic/BoolProperty';\nimport { ByteProperty } from './generic/ByteProperty';\nimport { DoubleProperty } from './generic/DoubleProperty';\nimport { EnumProperty } from './generic/EnumProperty';\nimport { FloatProperty } from './generic/FloatProperty';\nimport { Int32Property } from './generic/Int32Property';\nimport { Int64Property } from './generic/Int64Property';\nimport { Int8Property } from './generic/Int8Property';\nimport { MapProperty } from './generic/MapProperty';\nimport { ObjectProperty } from './generic/ObjectProperty';\nimport { SetProperty } from './generic/SetProperty';\nimport { SoftObjectProperty } from './generic/SoftObjectProperty';\nimport { StrProperty } from './generic/StrProperty';\nimport { StructProperty } from './generic/StructProperty';\nimport { TextProperty } from './generic/TextProperty';\nimport { Uint32Property } from './generic/Uint32Property';\nimport { Uint64Property } from './generic/Uint64Property';\nimport { Uint8Property } from './generic/Uint8Property';\n\n\nexport namespace PropertiesList {\n\n\texport const ParseList = (obj: SaveObject, length: number, reader: BinaryReadable, buildVersion: number, typePath: string): void => {\n\n\t\tobj.properties = {};\n\t\tif (length === 0) {\n\t\t\tconsole.warn(`properties length for object ${obj.instanceName} was indicated as 0. Which is suspicious. Skipping object properties.`);\n\t\t\treturn;\n\t\t}\n\n\t\tlet propertyName: string = reader.readString();\n\t\twhile (propertyName !== 'None') {\n\t\t\tconst parsedProperty = PropertiesList.ParseSingleProperty(reader, buildVersion, propertyName);\n\n\t\t\t// if it already exists, make it an array.\n\t\t\tif (obj.properties[propertyName]) {\n\t\t\t\tif (!Array.isArray(obj.properties[propertyName])) {\n\t\t\t\t\tobj.properties[propertyName] = [obj.properties[propertyName] as AbstractBaseProperty];\n\t\t\t\t}\n\t\t\t\t(obj.properties[propertyName] as AbstractBaseProperty[]).push(parsedProperty);\n\t\t\t} else {\n\t\t\t\tobj.properties[propertyName] = parsedProperty;\n\t\t\t}\n\n\t\t\tpropertyName = reader.readString();\n\t\t}\n\n\t}\n\n\texport const SerializeList = (obj: SaveObject, writer: SaveWriter, buildVersion: number, typePath: string): void => {\n\t\tfor (const property of Object.values(obj.properties).flatMap(val => Array.isArray(val) ? val : [val])) {\n\t\t\twriter.writeString(property.name);\n\t\t\tPropertiesList.SerializeSingleProperty(writer, property, property.name, buildVersion);\n\t\t}\n\t\twriter.writeString('None');\n\t}\n\n\texport const ParseSingleProperty = (reader: BinaryReadable, buildVersion: number, propertyName: string): AbstractBaseProperty => {\n\t\tlet currentProperty: any = {};\n\n\t\t//TODO assign type and index after parsing.\n\t\tconst propertyType = reader.readString();\n\t\tconst binarySize = reader.readInt32();\n\n\t\tconst index = reader.readInt32();\n\t\tconst before = reader.getBufferPosition();\n\n\t\tlet overhead = 0;\n\t\tswitch (propertyType) {\n\t\t\tcase 'BoolProperty':\n\t\t\t\tcurrentProperty = BoolProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = BoolProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\tcurrentProperty = ByteProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = ByteProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int8Property':\n\t\t\t\tcurrentProperty = Int8Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int8Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'UInt8Property':\n\t\t\t\tcurrentProperty = Uint8Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Uint8Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'IntProperty':\n\t\t\tcase 'Int32Property':\n\t\t\t\tcurrentProperty = Int32Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int32Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt32Property':\n\t\t\t\tcurrentProperty = Uint32Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Uint32Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int64Property':\n\t\t\t\tcurrentProperty = Int64Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int64Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt64Property':\n\t\t\t\tcurrentProperty = Uint64Property.Parse(reader, propertyType, index);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SingleProperty':\n\t\t\tcase 'FloatProperty':\n\t\t\t\tcurrentProperty = FloatProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = FloatProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'DoubleProperty':\n\t\t\t\tcurrentProperty = DoubleProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = DoubleProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StrProperty':\n\t\t\tcase 'NameProperty':\n\t\t\t\tcurrentProperty = StrProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = StrProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ObjectProperty':\n\t\t\tcase 'InterfaceProperty':\n\t\t\t\tcurrentProperty = ObjectProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = ObjectProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SoftObjectProperty':\n\t\t\t\tcurrentProperty = SoftObjectProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = SoftObjectProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'EnumProperty':\n\t\t\t\tcurrentProperty = EnumProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = EnumProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StructProperty':\n\t\t\t\tcurrentProperty = StructProperty.Parse(reader, propertyType, index, binarySize);\n\t\t\t\toverhead = StructProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrayProperty':\n\t\t\t\tcurrentProperty = ArrayProperty.Parse(reader, propertyType, index, propertyName);\n\t\t\t\toverhead = ArrayProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'MapProperty':\n\t\t\t\tcurrentProperty = MapProperty.Parse(reader, propertyName, buildVersion, binarySize);\n\t\t\t\toverhead = MapProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'TextProperty':\n\t\t\t\tcurrentProperty = TextProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = TextProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SetProperty':\n\t\t\t\tcurrentProperty = SetProperty.Parse(reader, propertyType, index, propertyName);\n\t\t\t\toverhead = SetProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unimplemented type ${propertyType}`);\n\t\t}\n\n\t\tcurrentProperty.name = propertyName;\n\n\t\tconst readBytes = reader.getBufferPosition() - before - overhead;\n\t\tif (readBytes !== binarySize) {\n\t\t\tconsole.warn(`possibly corrupt. Read ${readBytes} for ${propertyType} ${propertyName}, but ${binarySize} were indicated.`);\n\t\t\tthrow new ParserError('ParserError', `possibly corrupt. Read ${readBytes} bytes for ${propertyType} ${propertyName}, but ${binarySize} bytes were indicated.`);\n\t\t}\n\n\t\treturn currentProperty;\n\t}\n\n\texport const SerializeSingleProperty = (writer: ByteWriter, property: AbstractBaseProperty, propertyName: string, buildVersion: number): void => {\n\n\t\twriter.writeString(property.ueType);\n\n\t\t// binary length indicator\n\t\tconst lenIndicator = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\n\n\t\t// write index if it is not 0. Since it normally is.\n\t\twriter.writeInt32(property.index ?? 0);\n\n\t\tconst start = writer.getBufferPosition();\n\t\tlet overhead = 0;\n\t\tswitch (property.ueType) {\n\t\t\tcase 'BoolProperty':\n\t\t\t\toverhead = BoolProperty.CalcOverhead(property as BoolProperty);\n\t\t\t\tBoolProperty.Serialize(writer, property as BoolProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\toverhead = ByteProperty.CalcOverhead(property as ByteProperty);\n\t\t\t\tByteProperty.Serialize(writer, property as ByteProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int8Property':\n\t\t\t\toverhead = Int8Property.CalcOverhead(property as Int8Property);\n\t\t\t\tInt8Property.Serialize(writer, property as Int8Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt8Property':\n\t\t\t\toverhead = Uint8Property.CalcOverhead(property as Uint8Property);\n\t\t\t\tUint8Property.Serialize(writer, property as Uint8Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'IntProperty':\n\t\t\tcase 'Int32Property':\n\t\t\t\toverhead = Int32Property.CalcOverhead(property as Int32Property);\n\t\t\t\tInt32Property.Serialize(writer, property as Int32Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt32Property':\n\t\t\t\toverhead = Uint32Property.CalcOverhead(property as Uint32Property);\n\t\t\t\tUint32Property.Serialize(writer, property as Uint32Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int64Property':\n\t\t\t\toverhead = Int64Property.CalcOverhead(property as Int64Property);\n\t\t\t\tInt64Property.Serialize(writer, property as Int64Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt64PRoperty':\n\t\t\t\toverhead = Uint64Property.CalcOverhead(property as Int64Property);\n\t\t\t\tUint64Property.Serialize(writer, property as Int64Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SingleProperty':\n\t\t\tcase 'FloatProperty':\n\t\t\t\toverhead = FloatProperty.CalcOverhead(property as FloatProperty);\n\t\t\t\tFloatProperty.Serialize(writer, property as FloatProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'DoubleProperty':\n\t\t\t\toverhead = DoubleProperty.CalcOverhead(property as DoubleProperty);\n\t\t\t\tDoubleProperty.Serialize(writer, property as DoubleProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StrProperty':\n\t\t\tcase 'NameProperty':\n\t\t\t\toverhead = StrProperty.CalcOverhead(property as StrProperty);\n\t\t\t\tStrProperty.Serialize(writer, property as StrProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ObjectProperty':\n\t\t\tcase 'InterfaceProperty':\n\t\t\t\toverhead = ObjectProperty.CalcOverhead(property as ObjectProperty);\n\t\t\t\tObjectProperty.Serialize(writer, property as ObjectProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SoftObjectProperty':\n\t\t\t\toverhead = SoftObjectProperty.CalcOverhead(property as SoftObjectProperty);\n\t\t\t\tSoftObjectProperty.Serialize(writer, property as SoftObjectProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'EnumProperty':\n\t\t\t\toverhead = EnumProperty.CalcOverhead(property as EnumProperty);\n\t\t\t\tEnumProperty.Serialize(writer, property as EnumProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\toverhead = ByteProperty.CalcOverhead(property as ByteProperty);\n\t\t\t\tByteProperty.Serialize(writer, property as ByteProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StructProperty':\n\t\t\t\toverhead = StructProperty.CalcOverhead(property as StructProperty);\n\t\t\t\tStructProperty.Serialize(writer, property as StructProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrayProperty':\n\t\t\t\toverhead = ArrayProperty.CalcOverhead(property as ArrayProperty<any>);\n\t\t\t\tArrayProperty.Serialize(writer, property as ArrayProperty<any>, propertyName);\n\t\t\t\tbreak;\n\n\t\t\tcase 'MapProperty':\n\t\t\t\toverhead = MapProperty.CalcOverhead(property as MapProperty);\n\t\t\t\tMapProperty.Serialize(writer, property as MapProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'TextProperty':\n\t\t\t\toverhead = TextProperty.CalcOverhead(property as TextProperty);\n\t\t\t\tTextProperty.Serialize(writer, property as TextProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SetProperty':\n\t\t\t\toverhead = SetProperty.CalcOverhead(property as SetProperty<any>);\n\t\t\t\tSetProperty.Serialize(writer, property as SetProperty<any>);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unimplemented type ${property.type}`);\n\t\t}\n\n\t\t// replace len indicator.\n\t\twriter.writeBinarySizeFromPosition(lenIndicator, start + overhead);\n\t}\n}\n\n"]}
1
+ {"version":3,"file":"PropertiesList.js","sourceRoot":"","sources":["../../../../../src/parser/satisfactory/types/property/PropertiesList.ts"],"names":[],"mappings":";;;AAEA,8DAA0D;AAC1D,2DAAwD;AAExD,yDAAsD;AACtD,yDAAsD;AACtD,6DAA0D;AAC1D,yDAAsD;AACtD,2DAAwD;AACxD,2DAAwD;AACxD,2DAAwD;AACxD,yDAAsD;AACtD,uDAAoD;AACpD,6DAA0D;AAC1D,uDAAoD;AACpD,qEAAkE;AAClE,uDAAoD;AACpD,6DAA0D;AAC1D,yDAAsD;AACtD,6DAA0D;AAC1D,6DAA0D;AAC1D,2DAAwD;AAGxD,IAAiB,cAAc,CA4R9B;AA5RD,WAAiB,cAAc;IAEjB,wBAAS,GAAG,CAAC,MAAsB,EAAE,YAAoB,EAAiB,EAAE;QAExF,MAAM,UAAU,GAAkB,EAAE,CAAC;QACrC,IAAI,YAAY,GAAW,MAAM,CAAC,UAAU,EAAE,CAAC;QAC/C,OAAO,YAAY,KAAK,MAAM,EAAE,CAAC;YAChC,MAAM,cAAc,GAAG,cAAc,CAAC,mBAAmB,CAAC,MAAM,EAAE,YAAY,EAAE,YAAY,CAAC,CAAC;YAG9F,IAAI,UA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0B,CAAC,CAAC;gBAC7D,MAAM;YAEP,KAAK,eAAe;gBACnB,QAAQ,GAAG,6BAAa,CAAC,YAAY,CAAC,QAA8B,CAAC,CAAC;gBACtE,6BAAa,CAAC,SAAS,CAAC,MAAM,EAAE,QAA8B,EAAE,YAAY,CAAC,CAAC;gBAC9E,MAAM;YAEP,KAAK,aAAa;gBACjB,QAAQ,GAAG,yBAAW,CAAC,YAAY,CAAC,QAAuB,CAAC,CAAC;gBAC7D,yBAAW,CAAC,SAAS,CAAC,MAAM,EAAE,QAAuB,CAAC,CAAC;gBACvD,MAAM;YAEP,KAAK,cAAc;gBAClB,QAAQ,GAAG,2BAAY,CAAC,YAAY,CAAC,QAAwB,CAAC,CAAC;gBAC/D,2BAAY,CAAC,SAAS,CAAC,MAAM,EAAE,QAAwB,CAAC,CAAC;gBACzD,MAAM;YAEP,KAAK,aAAa;gBACjB,QAAQ,GAAG,yBAAW,CAAC,YAAY,CAAC,QAA4B,CAAC,CAAC;gBAClE,yBAAW,CAAC,SAAS,CAAC,MAAM,EAAE,QAA4B,CAAC,CAAC;gBAC5D,MAAM;YAEP;gBACC,MAAM,IAAI,KAAK,CAAC,sBAAsB,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QACzD,CAAC;QAGD,MAAM,CAAC,2BAA2B,CAAC,YAAY,EAAE,KAAK,GAAG,QAAQ,CAAC,CAAC;IACpE,CAAC,CAAA;AACF,CAAC,EA5RgB,cAAc,8BAAd,cAAc,QA4R9B","sourcesContent":["import { BinaryReadable } from '../../../byte/binary-readable.interface';\nimport { ByteWriter } from '../../../byte/byte-writer.class';\nimport { ParserError } from '../../../error/parser.error';\nimport { ArrayProperty } from './generic/ArrayProperty';\nimport { AbstractBaseProperty, PropertiesMap } from './generic/BasicProperty';\nimport { BoolProperty } from './generic/BoolProperty';\nimport { ByteProperty } from './generic/ByteProperty';\nimport { DoubleProperty } from './generic/DoubleProperty';\nimport { EnumProperty } from './generic/EnumProperty';\nimport { FloatProperty } from './generic/FloatProperty';\nimport { Int32Property } from './generic/Int32Property';\nimport { Int64Property } from './generic/Int64Property';\nimport { Int8Property } from './generic/Int8Property';\nimport { MapProperty } from './generic/MapProperty';\nimport { ObjectProperty } from './generic/ObjectProperty';\nimport { SetProperty } from './generic/SetProperty';\nimport { SoftObjectProperty } from './generic/SoftObjectProperty';\nimport { StrProperty } from './generic/StrProperty';\nimport { StructProperty } from './generic/StructProperty';\nimport { TextProperty } from './generic/TextProperty';\nimport { Uint32Property } from './generic/Uint32Property';\nimport { Uint64Property } from './generic/Uint64Property';\nimport { Uint8Property } from './generic/Uint8Property';\n\n\nexport namespace PropertiesList {\n\n\texport const ParseList = (reader: BinaryReadable, buildVersion: number): PropertiesMap => {\n\n\t\tconst properties: PropertiesMap = {};\n\t\tlet propertyName: string = reader.readString();\n\t\twhile (propertyName !== 'None') {\n\t\t\tconst parsedProperty = PropertiesList.ParseSingleProperty(reader, buildVersion, propertyName);\n\n\t\t\t// if it already exists, make it an array.\n\t\t\tif (properties[propertyName]) {\n\t\t\t\tif (!Array.isArray(properties[propertyName])) {\n\t\t\t\t\tproperties[propertyName] = [properties[propertyName] as AbstractBaseProperty];\n\t\t\t\t}\n\t\t\t\t(properties[propertyName] as AbstractBaseProperty[]).push(parsedProperty);\n\t\t\t} else {\n\t\t\t\tproperties[propertyName] = parsedProperty;\n\t\t\t}\n\n\t\t\tpropertyName = reader.readString();\n\t\t}\n\n\t\treturn properties;\n\t}\n\n\texport const SerializeList = (properties: PropertiesMap, writer: ByteWriter, buildVersion: number): void => {\n\t\tfor (const property of Object.values(properties).flatMap(val => Array.isArray(val) ? val : [val])) {\n\t\t\twriter.writeString(property.name);\n\t\t\tPropertiesList.SerializeSingleProperty(writer, property, property.name, buildVersion);\n\t\t}\n\t\twriter.writeString('None');\n\t}\n\n\texport const ParseSingleProperty = (reader: BinaryReadable, buildVersion: number, propertyName: string): AbstractBaseProperty => {\n\t\tlet currentProperty: any = {};\n\n\t\t//TODO assign type and index after parsing.\n\t\tconst propertyType = reader.readString();\n\t\tconst binarySize = reader.readInt32();\n\n\t\tconst index = reader.readInt32();\n\t\tconst before = reader.getBufferPosition();\n\n\t\tlet overhead = 0;\n\t\tswitch (propertyType) {\n\t\t\tcase 'BoolProperty':\n\t\t\t\tcurrentProperty = BoolProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = BoolProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\tcurrentProperty = ByteProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = ByteProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int8Property':\n\t\t\t\tcurrentProperty = Int8Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int8Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'UInt8Property':\n\t\t\t\tcurrentProperty = Uint8Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Uint8Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'IntProperty':\n\t\t\tcase 'Int32Property':\n\t\t\t\tcurrentProperty = Int32Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int32Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt32Property':\n\t\t\t\tcurrentProperty = Uint32Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Uint32Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int64Property':\n\t\t\t\tcurrentProperty = Int64Property.Parse(reader, propertyType, index);\n\t\t\t\toverhead = Int64Property.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt64Property':\n\t\t\t\tcurrentProperty = Uint64Property.Parse(reader, propertyType, index);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SingleProperty':\n\t\t\tcase 'FloatProperty':\n\t\t\t\tcurrentProperty = FloatProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = FloatProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'DoubleProperty':\n\t\t\t\tcurrentProperty = DoubleProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = DoubleProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StrProperty':\n\t\t\tcase 'NameProperty':\n\t\t\t\tcurrentProperty = StrProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = StrProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ObjectProperty':\n\t\t\tcase 'InterfaceProperty':\n\t\t\t\tcurrentProperty = ObjectProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = ObjectProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SoftObjectProperty':\n\t\t\t\tcurrentProperty = SoftObjectProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = SoftObjectProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'EnumProperty':\n\t\t\t\tcurrentProperty = EnumProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = EnumProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StructProperty':\n\t\t\t\tcurrentProperty = StructProperty.Parse(reader, propertyType, index, binarySize);\n\t\t\t\toverhead = StructProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrayProperty':\n\t\t\t\tcurrentProperty = ArrayProperty.Parse(reader, propertyType, index, propertyName);\n\t\t\t\toverhead = ArrayProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'MapProperty':\n\t\t\t\tcurrentProperty = MapProperty.Parse(reader, propertyName, buildVersion, binarySize);\n\t\t\t\toverhead = MapProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'TextProperty':\n\t\t\t\tcurrentProperty = TextProperty.Parse(reader, propertyType, index);\n\t\t\t\toverhead = TextProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SetProperty':\n\t\t\t\tcurrentProperty = SetProperty.Parse(reader, propertyType, index, propertyName);\n\t\t\t\toverhead = SetProperty.CalcOverhead(currentProperty);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unimplemented type ${propertyType}`);\n\t\t}\n\n\t\tcurrentProperty.name = propertyName;\n\n\t\tconst readBytes = reader.getBufferPosition() - before - overhead;\n\t\tif (readBytes !== binarySize) {\n\t\t\tconsole.warn(`possibly corrupt. Read ${readBytes} for ${propertyType} ${propertyName}, but ${binarySize} were indicated.`);\n\t\t\tthrow new ParserError('ParserError', `possibly corrupt. Read ${readBytes} bytes for ${propertyType} ${propertyName}, but ${binarySize} bytes were indicated.`);\n\t\t}\n\n\t\treturn currentProperty;\n\t}\n\n\texport const SerializeSingleProperty = (writer: ByteWriter, property: AbstractBaseProperty, propertyName: string, buildVersion: number): void => {\n\n\t\twriter.writeString(property.ueType);\n\n\t\t// binary length indicator\n\t\tconst lenIndicator = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\n\n\t\t// write index if it is not 0. Since it normally is.\n\t\twriter.writeInt32(property.index ?? 0);\n\n\t\tconst start = writer.getBufferPosition();\n\t\tlet overhead = 0;\n\t\tswitch (property.ueType) {\n\t\t\tcase 'BoolProperty':\n\t\t\t\toverhead = BoolProperty.CalcOverhead(property as BoolProperty);\n\t\t\t\tBoolProperty.Serialize(writer, property as BoolProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\toverhead = ByteProperty.CalcOverhead(property as ByteProperty);\n\t\t\t\tByteProperty.Serialize(writer, property as ByteProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int8Property':\n\t\t\t\toverhead = Int8Property.CalcOverhead(property as Int8Property);\n\t\t\t\tInt8Property.Serialize(writer, property as Int8Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt8Property':\n\t\t\t\toverhead = Uint8Property.CalcOverhead(property as Uint8Property);\n\t\t\t\tUint8Property.Serialize(writer, property as Uint8Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'IntProperty':\n\t\t\tcase 'Int32Property':\n\t\t\t\toverhead = Int32Property.CalcOverhead(property as Int32Property);\n\t\t\t\tInt32Property.Serialize(writer, property as Int32Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt32Property':\n\t\t\t\toverhead = Uint32Property.CalcOverhead(property as Uint32Property);\n\t\t\t\tUint32Property.Serialize(writer, property as Uint32Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'Int64Property':\n\t\t\t\toverhead = Int64Property.CalcOverhead(property as Int64Property);\n\t\t\t\tInt64Property.Serialize(writer, property as Int64Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'UInt64PRoperty':\n\t\t\t\toverhead = Uint64Property.CalcOverhead(property as Int64Property);\n\t\t\t\tUint64Property.Serialize(writer, property as Int64Property);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SingleProperty':\n\t\t\tcase 'FloatProperty':\n\t\t\t\toverhead = FloatProperty.CalcOverhead(property as FloatProperty);\n\t\t\t\tFloatProperty.Serialize(writer, property as FloatProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'DoubleProperty':\n\t\t\t\toverhead = DoubleProperty.CalcOverhead(property as DoubleProperty);\n\t\t\t\tDoubleProperty.Serialize(writer, property as DoubleProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StrProperty':\n\t\t\tcase 'NameProperty':\n\t\t\t\toverhead = StrProperty.CalcOverhead(property as StrProperty);\n\t\t\t\tStrProperty.Serialize(writer, property as StrProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ObjectProperty':\n\t\t\tcase 'InterfaceProperty':\n\t\t\t\toverhead = ObjectProperty.CalcOverhead(property as ObjectProperty);\n\t\t\t\tObjectProperty.Serialize(writer, property as ObjectProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SoftObjectProperty':\n\t\t\t\toverhead = SoftObjectProperty.CalcOverhead(property as SoftObjectProperty);\n\t\t\t\tSoftObjectProperty.Serialize(writer, property as SoftObjectProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'EnumProperty':\n\t\t\t\toverhead = EnumProperty.CalcOverhead(property as EnumProperty);\n\t\t\t\tEnumProperty.Serialize(writer, property as EnumProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ByteProperty':\n\t\t\t\toverhead = ByteProperty.CalcOverhead(property as ByteProperty);\n\t\t\t\tByteProperty.Serialize(writer, property as ByteProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'StructProperty':\n\t\t\t\toverhead = StructProperty.CalcOverhead(property as StructProperty);\n\t\t\t\tStructProperty.Serialize(writer, property as StructProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ArrayProperty':\n\t\t\t\toverhead = ArrayProperty.CalcOverhead(property as ArrayProperty<any>);\n\t\t\t\tArrayProperty.Serialize(writer, property as ArrayProperty<any>, propertyName);\n\t\t\t\tbreak;\n\n\t\t\tcase 'MapProperty':\n\t\t\t\toverhead = MapProperty.CalcOverhead(property as MapProperty);\n\t\t\t\tMapProperty.Serialize(writer, property as MapProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'TextProperty':\n\t\t\t\toverhead = TextProperty.CalcOverhead(property as TextProperty);\n\t\t\t\tTextProperty.Serialize(writer, property as TextProperty);\n\t\t\t\tbreak;\n\n\t\t\tcase 'SetProperty':\n\t\t\t\toverhead = SetProperty.CalcOverhead(property as SetProperty<any>);\n\t\t\t\tSetProperty.Serialize(writer, property as SetProperty<any>);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unimplemented type ${property.type}`);\n\t\t}\n\n\t\t// replace len indicator.\n\t\twriter.writeBinarySizeFromPosition(lenIndicator, start + overhead);\n\t}\n}\n\n"]}