@etothepii/satisfactory-file-parser 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (550) hide show
  1. package/.github/workflows/publish-jsr.yml +21 -0
  2. package/.github/workflows/tests.yml +2 -1
  3. package/CHANGELOG.md +12 -4
  4. package/README.md +6 -6
  5. package/build/index.d.ts +2 -1
  6. package/build/index.d.ts.map +1 -1
  7. package/build/index.js +2 -1
  8. package/build/index.js.map +1 -1
  9. package/build/parser/parser.d.ts.map +1 -1
  10. package/build/parser/parser.js +5 -3
  11. package/build/parser/parser.js.map +1 -1
  12. package/build/parser/satisfactory/blueprint/blueprint-config.d.ts.map +1 -1
  13. package/build/parser/satisfactory/blueprint/blueprint-config.js.map +1 -1
  14. package/build/parser/satisfactory/blueprint/blueprint-header.d.ts +1 -8
  15. package/build/parser/satisfactory/blueprint/blueprint-header.d.ts.map +1 -1
  16. package/build/parser/satisfactory/blueprint/blueprint-header.js.map +1 -1
  17. package/build/parser/satisfactory/blueprint/blueprint-reader.js +2 -2
  18. package/build/parser/satisfactory/blueprint/blueprint-reader.js.map +1 -1
  19. package/build/parser/satisfactory/blueprint/blueprint-writer.js +2 -2
  20. package/build/parser/satisfactory/blueprint/blueprint-writer.js.map +1 -1
  21. package/build/parser/satisfactory/edit/edit-constants.d.ts +62 -0
  22. package/build/parser/satisfactory/edit/edit-constants.d.ts.map +1 -1
  23. package/build/parser/satisfactory/edit/edit-constants.js +62 -0
  24. package/build/parser/satisfactory/edit/edit-constants.js.map +1 -1
  25. package/build/parser/satisfactory/save/level-to-destroyed-actors-map.d.ts +9 -0
  26. package/build/parser/satisfactory/save/level-to-destroyed-actors-map.d.ts.map +1 -0
  27. package/build/parser/satisfactory/save/level-to-destroyed-actors-map.js +32 -0
  28. package/build/parser/satisfactory/save/level-to-destroyed-actors-map.js.map +1 -0
  29. package/build/parser/satisfactory/save/level.class.d.ts +2 -3
  30. package/build/parser/satisfactory/save/level.class.d.ts.map +1 -1
  31. package/build/parser/satisfactory/save/level.class.js +17 -27
  32. package/build/parser/satisfactory/save/level.class.js.map +1 -1
  33. package/build/parser/satisfactory/save/level.d.ts +29 -0
  34. package/build/parser/satisfactory/save/level.d.ts.map +1 -0
  35. package/build/parser/satisfactory/save/level.js +204 -0
  36. package/build/parser/satisfactory/save/level.js.map +1 -0
  37. package/build/parser/satisfactory/save/satisfactory-save-header.d.ts.map +1 -1
  38. package/build/parser/satisfactory/save/satisfactory-save-header.js.map +1 -1
  39. package/build/parser/satisfactory/save/satisfactory-save.d.ts +1 -1
  40. package/build/parser/satisfactory/save/satisfactory-save.d.ts.map +1 -1
  41. package/build/parser/satisfactory/save/satisfactory-save.js.map +1 -1
  42. package/build/parser/satisfactory/save/save-reader.d.ts +1 -1
  43. package/build/parser/satisfactory/save/save-reader.d.ts.map +1 -1
  44. package/build/parser/satisfactory/save/save-reader.js +2 -2
  45. package/build/parser/satisfactory/save/save-reader.js.map +1 -1
  46. package/build/parser/satisfactory/save/save-writer.js +2 -2
  47. package/build/parser/satisfactory/save/save-writer.js.map +1 -1
  48. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.d.ts +3 -3
  49. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.d.ts.map +1 -1
  50. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.js.map +1 -1
  51. package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.d.ts +5 -5
  52. package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.d.ts.map +1 -1
  53. package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.js.map +1 -1
  54. package/build/parser/satisfactory/types/property/generic/StructProperty.d.ts.map +1 -1
  55. package/build/parser/satisfactory/types/property/generic/StructProperty.js +3 -3
  56. package/build/parser/satisfactory/types/property/generic/StructProperty.js.map +1 -1
  57. package/build/parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties.d.ts +1 -14
  58. package/build/parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties.d.ts.map +1 -1
  59. package/build/parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties.js.map +1 -1
  60. package/build/parser/satisfactory/types/property/special/CircuitSpecialProperties.d.ts.map +1 -1
  61. package/build/parser/satisfactory/types/property/special/CircuitSpecialProperties.js.map +1 -1
  62. package/build/parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties.d.ts.map +1 -1
  63. package/build/parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties.js.map +1 -1
  64. package/build/parser/satisfactory/types/property/special/ConveyorSpecialProperties.d.ts.map +1 -1
  65. package/build/parser/satisfactory/types/property/special/ConveyorSpecialProperties.js.map +1 -1
  66. package/build/parser/satisfactory/types/property/special/ObjectsListSpecialProperties.d.ts.map +1 -1
  67. package/build/parser/satisfactory/types/property/special/ObjectsListSpecialProperties.js.map +1 -1
  68. package/build/parser/satisfactory/types/property/special/PlayerSpecialProperties.d.ts.map +1 -1
  69. package/build/parser/satisfactory/types/property/special/PlayerSpecialProperties.js.map +1 -1
  70. package/build/parser/satisfactory/types/property/special/PowerLineSpecialProperties.d.ts.map +1 -1
  71. package/build/parser/satisfactory/types/property/special/PowerLineSpecialProperties.js.map +1 -1
  72. package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.d.ts.map +1 -1
  73. package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.js.map +1 -1
  74. package/build/parser/satisfactory/types/property/special/SpecialProperties.d.ts +2 -2
  75. package/build/parser/satisfactory/types/property/special/SpecialProperties.d.ts.map +1 -1
  76. package/build/parser/satisfactory/types/property/special/SpecialProperties.js.map +1 -1
  77. package/build/parser/satisfactory/types/property/special/VehicleSpecialProperties.d.ts.map +1 -1
  78. package/build/parser/satisfactory/types/property/special/VehicleSpecialProperties.js.map +1 -1
  79. package/build/parser/satisfactory/types/structs/VehiclePhysicsData.d.ts.map +1 -1
  80. package/build/parser/satisfactory/types/structs/VehiclePhysicsData.js.map +1 -1
  81. package/build/parser/stream/reworked/readable-stream-parser.d.ts.map +1 -1
  82. package/build/parser/stream/reworked/readable-stream-parser.js +12 -15
  83. package/build/parser/stream/reworked/readable-stream-parser.js.map +1 -1
  84. package/build/parser/stream/reworked/save-stream-json-stringifier.d.ts.map +1 -1
  85. package/build/parser/stream/reworked/save-stream-json-stringifier.js.map +1 -1
  86. package/build/parser/stream/reworked/save-stream-writer.class.d.ts.map +1 -1
  87. package/build/parser/stream/reworked/save-stream-writer.class.js.map +1 -1
  88. package/docs/assets/navigation.js +1 -1
  89. package/docs/assets/search.js +1 -1
  90. package/docs/classes/BlueprintConfigReader.html +4 -4
  91. package/docs/classes/BlueprintConfigWriter.html +4 -4
  92. package/docs/classes/BlueprintReader.html +4 -4
  93. package/docs/classes/BlueprintWriter.html +4 -4
  94. package/docs/classes/CompressionLibraryError.html +2 -2
  95. package/docs/classes/CorruptBlueprintError.html +2 -2
  96. package/docs/classes/CorruptSaveError.html +2 -2
  97. package/docs/classes/Parser.html +6 -6
  98. package/docs/classes/ParserError.html +2 -2
  99. package/docs/classes/ReadableStreamParser.html +2 -2
  100. package/docs/classes/SatisfactorySave.html +2 -2
  101. package/docs/classes/SaveComponent.html +2 -2
  102. package/docs/classes/SaveEntity.html +2 -2
  103. package/docs/classes/SaveObject.html +2 -2
  104. package/docs/classes/SaveReader.html +4 -4
  105. package/docs/classes/SaveStreamJsonStringifier.html +5 -4
  106. package/docs/classes/SaveStreamWriter.html +17 -16
  107. package/docs/classes/SaveWriter.html +4 -4
  108. package/docs/classes/TimeoutError.html +2 -2
  109. package/docs/classes/UnimplementedError.html +2 -2
  110. package/docs/classes/UnsupportedVersionError.html +2 -2
  111. package/docs/enums/BlueprintConfigVersion.html +2 -2
  112. package/docs/enums/CompressionAlgorithmCode.html +2 -2
  113. package/docs/enums/FactoryGameCustomVersion.html +2 -2
  114. package/docs/enums/RuntimeBuildableInstanceDataVersion.html +2 -2
  115. package/docs/enums/SaveCustomVersion.html +10 -10
  116. package/docs/enums/SaveHeaderType.html +2 -2
  117. package/docs/functions/AbstractBaseProperty.Create.html +1 -1
  118. package/docs/functions/ArrayProperty.CalcOverhead.html +1 -1
  119. package/docs/functions/ArrayProperty.Parse.html +1 -1
  120. package/docs/functions/ArrayProperty.Serialize.html +1 -1
  121. package/docs/functions/BlueprintConfig.Parse.html +1 -1
  122. package/docs/functions/BlueprintConfig.Serialize.html +1 -1
  123. package/docs/functions/BlueprintHeader.Parse.html +1 -1
  124. package/docs/functions/BlueprintHeader.Serialize.html +1 -1
  125. package/docs/functions/BoolArrayProperty.Parse.html +1 -1
  126. package/docs/functions/BoolArrayProperty.Serialize.html +1 -1
  127. package/docs/functions/BoolProperty.CalcOverhead.html +1 -1
  128. package/docs/functions/BoolProperty.Parse.html +1 -1
  129. package/docs/functions/BoolProperty.ReadValue.html +1 -1
  130. package/docs/functions/BoolProperty.Serialize.html +1 -1
  131. package/docs/functions/BoolProperty.SerializeValue.html +1 -1
  132. package/docs/functions/BuildableSubsystemSpecialProperties.Parse.html +1 -1
  133. package/docs/functions/BuildableSubsystemSpecialProperties.Serialize.html +1 -1
  134. package/docs/functions/BuildableTypeInstance.Parse.html +1 -1
  135. package/docs/functions/BuildableTypeInstance.Serialize.html +1 -1
  136. package/docs/functions/ByteArrayProperty.Parse.html +1 -1
  137. package/docs/functions/ByteArrayProperty.Serialize.html +1 -1
  138. package/docs/functions/ByteProperty.CalcOverhead.html +1 -1
  139. package/docs/functions/ByteProperty.Parse.html +1 -1
  140. package/docs/functions/ByteProperty.ReadValue.html +1 -1
  141. package/docs/functions/ByteProperty.Serialize.html +1 -1
  142. package/docs/functions/ByteProperty.SerializeValue.html +1 -1
  143. package/docs/functions/CircuitSpecialProperties.Parse.html +1 -1
  144. package/docs/functions/CircuitSpecialProperties.Serialize.html +1 -1
  145. package/docs/functions/ConveyorChainActorSpecialProperties.Parse.html +1 -1
  146. package/docs/functions/ConveyorChainActorSpecialProperties.Serialize.html +1 -1
  147. package/docs/functions/ConveyorSpecialProperties.Parse.html +1 -1
  148. package/docs/functions/ConveyorSpecialProperties.Serialize.html +1 -1
  149. package/docs/functions/DoubleArrayProperty.Parse.html +1 -1
  150. package/docs/functions/DoubleArrayProperty.Serialize.html +1 -1
  151. package/docs/functions/DoubleProperty.CalcOverhead.html +1 -1
  152. package/docs/functions/DoubleProperty.Parse.html +1 -1
  153. package/docs/functions/DoubleProperty.ReadValue.html +1 -1
  154. package/docs/functions/DoubleProperty.Serialize.html +1 -1
  155. package/docs/functions/DoubleProperty.SerializeValue.html +1 -1
  156. package/docs/functions/DynamicStructPropertyValue.read.html +1 -1
  157. package/docs/functions/DynamicStructPropertyValue.write.html +1 -1
  158. package/docs/functions/EmptySpecialProperties.Parse.html +1 -1
  159. package/docs/functions/EmptySpecialProperties.Serialize.html +1 -1
  160. package/docs/functions/EnumArrayProperty.Parse.html +1 -1
  161. package/docs/functions/EnumArrayProperty.Serialize.html +1 -1
  162. package/docs/functions/EnumProperty.CalcOverhead.html +1 -1
  163. package/docs/functions/EnumProperty.Parse.html +1 -1
  164. package/docs/functions/EnumProperty.ReadValue.html +1 -1
  165. package/docs/functions/EnumProperty.Serialize.html +1 -1
  166. package/docs/functions/EnumProperty.SerializeValue.html +1 -1
  167. package/docs/functions/FGDynamicStruct.Parse.html +1 -1
  168. package/docs/functions/FGDynamicStruct.Serialize.html +1 -1
  169. package/docs/functions/FICFrameRange.Parse.html +1 -1
  170. package/docs/functions/FICFrameRange.Serialize.html +1 -1
  171. package/docs/functions/FloatArrayProperty.Parse.html +1 -1
  172. package/docs/functions/FloatArrayProperty.Serialize.html +1 -1
  173. package/docs/functions/FloatProperty.CalcOverhead.html +1 -1
  174. package/docs/functions/FloatProperty.Parse.html +1 -1
  175. package/docs/functions/FloatProperty.ReadValue.html +1 -1
  176. package/docs/functions/FloatProperty.Serialize.html +1 -1
  177. package/docs/functions/FloatProperty.SerializeValue.html +1 -1
  178. package/docs/functions/GUID.read.html +1 -1
  179. package/docs/functions/GUID.write.html +1 -1
  180. package/docs/functions/GUIDInfo.read.html +1 -1
  181. package/docs/functions/GUIDInfo.write.html +1 -1
  182. package/docs/functions/Int32ArrayProperty.Parse.html +1 -1
  183. package/docs/functions/Int32ArrayProperty.Serialize.html +1 -1
  184. package/docs/functions/Int32Property.CalcOverhead.html +1 -1
  185. package/docs/functions/Int32Property.Parse.html +1 -1
  186. package/docs/functions/Int32Property.ReadValue.html +1 -1
  187. package/docs/functions/Int32Property.Serialize.html +1 -1
  188. package/docs/functions/Int32Property.SerializeValue.html +1 -1
  189. package/docs/functions/Int32SetProperty.Parse.html +1 -1
  190. package/docs/functions/Int32SetProperty.Serialize.html +1 -1
  191. package/docs/functions/Int64ArrayProperty.Parse.html +1 -1
  192. package/docs/functions/Int64ArrayProperty.Serialize.html +1 -1
  193. package/docs/functions/Int64Property.CalcOverhead.html +1 -1
  194. package/docs/functions/Int64Property.Parse.html +1 -1
  195. package/docs/functions/Int64Property.ReadValue.html +1 -1
  196. package/docs/functions/Int64Property.Serialize.html +1 -1
  197. package/docs/functions/Int64Property.SerializeValue.html +1 -1
  198. package/docs/functions/Int8Property.CalcOverhead.html +1 -1
  199. package/docs/functions/Int8Property.Parse.html +1 -1
  200. package/docs/functions/Int8Property.ReadValue.html +1 -1
  201. package/docs/functions/Int8Property.Serialize.html +1 -1
  202. package/docs/functions/Int8Property.SerializeValue.html +1 -1
  203. package/docs/functions/Level.ReadAllObjectContents.html +1 -1
  204. package/docs/functions/Level.ReadAllObjectHeaders.html +1 -1
  205. package/docs/functions/Level.ReadLevel.html +1 -1
  206. package/docs/functions/Level.ReadNObjectContents.html +1 -1
  207. package/docs/functions/Level.ReadNObjectHeaders.html +1 -1
  208. package/docs/functions/Level.SerializeAllObjectContents.html +1 -1
  209. package/docs/functions/Level.SerializeAllObjectHeaders.html +1 -1
  210. package/docs/functions/Level.SerializeLevel.html +1 -1
  211. package/docs/functions/LevelToDestroyedActorsMap.read.html +1 -0
  212. package/docs/functions/LevelToDestroyedActorsMap.write.html +1 -0
  213. package/docs/functions/MD5Hash.read.html +1 -1
  214. package/docs/functions/MD5Hash.write.html +1 -1
  215. package/docs/functions/MapProperty.CalcOverhead.html +1 -1
  216. package/docs/functions/MapProperty.Parse.html +1 -1
  217. package/docs/functions/MapProperty.Serialize.html +1 -1
  218. package/docs/functions/ObjectArrayProperty.Parse.html +1 -1
  219. package/docs/functions/ObjectArrayProperty.Serialize.html +1 -1
  220. package/docs/functions/ObjectProperty.CalcOverhead.html +1 -1
  221. package/docs/functions/ObjectProperty.Parse.html +1 -1
  222. package/docs/functions/ObjectProperty.ReadValue.html +1 -1
  223. package/docs/functions/ObjectProperty.Serialize.html +1 -1
  224. package/docs/functions/ObjectProperty.SerializeValue.html +1 -1
  225. package/docs/functions/ObjectReference.IsEqual.html +1 -1
  226. package/docs/functions/ObjectReference.read.html +1 -1
  227. package/docs/functions/ObjectReference.write.html +1 -1
  228. package/docs/functions/ObjectSetProperty.Parse.html +1 -1
  229. package/docs/functions/ObjectSetProperty.Serialize.html +1 -1
  230. package/docs/functions/ObjectsListSpecialProperties.Parse.html +1 -1
  231. package/docs/functions/ObjectsListSpecialProperties.Serialize.html +1 -1
  232. package/docs/functions/PlayerSpecialProperties.Parse.html +1 -1
  233. package/docs/functions/PlayerSpecialProperties.Serialize.html +1 -1
  234. package/docs/functions/PowerLineSpecialProperties.Parse.html +1 -1
  235. package/docs/functions/PowerLineSpecialProperties.Serialize.html +1 -1
  236. package/docs/functions/PropertiesList.ParseList.html +1 -1
  237. package/docs/functions/PropertiesList.ParseSingleProperty.html +1 -1
  238. package/docs/functions/PropertiesList.SerializeList.html +1 -1
  239. package/docs/functions/PropertiesList.SerializeSingleProperty.html +1 -1
  240. package/docs/functions/SatisfactorySaveHeader.Parse.html +1 -1
  241. package/docs/functions/SatisfactorySaveHeader.Serialize.html +1 -1
  242. package/docs/functions/SaveBodyChunks.CompressDataIntoChunks.html +1 -1
  243. package/docs/functions/SaveBodyChunks.DecompressChunks.html +1 -1
  244. package/docs/functions/SetProperty.CalcOverhead.html +1 -1
  245. package/docs/functions/SetProperty.Parse.html +1 -1
  246. package/docs/functions/SetProperty.Serialize.html +1 -1
  247. package/docs/functions/SoftObjectArrayProperty.Parse.html +1 -1
  248. package/docs/functions/SoftObjectArrayProperty.Serialize.html +1 -1
  249. package/docs/functions/SoftObjectReference.read.html +1 -1
  250. package/docs/functions/SoftObjectReference.write.html +1 -1
  251. package/docs/functions/SpecialDroneActionProperties.Parse.html +1 -1
  252. package/docs/functions/SpecialDroneActionProperties.Serialize.html +1 -1
  253. package/docs/functions/SpecialProperties.ParseClassSpecificSpecialProperties.html +1 -1
  254. package/docs/functions/SpecialProperties.SerializeClassSpecificSpecialProperties.html +1 -1
  255. package/docs/functions/StrArrayProperty.Parse.html +1 -1
  256. package/docs/functions/StrArrayProperty.Serialize.html +1 -1
  257. package/docs/functions/StrProperty.CalcOverhead.html +1 -1
  258. package/docs/functions/StrProperty.Parse.html +1 -1
  259. package/docs/functions/StrProperty.ReadValue.html +1 -1
  260. package/docs/functions/StrProperty.Serialize.html +1 -1
  261. package/docs/functions/StrProperty.SerializeValue.html +1 -1
  262. package/docs/functions/StrSetProperty.Parse.html +1 -1
  263. package/docs/functions/StrSetProperty.Serialize.html +1 -1
  264. package/docs/functions/StructArrayProperty.Parse.html +1 -1
  265. package/docs/functions/StructArrayProperty.Serialize.html +1 -1
  266. package/docs/functions/StructProperty.CalcOverhead.html +1 -1
  267. package/docs/functions/StructProperty.Parse.html +1 -1
  268. package/docs/functions/StructProperty.ParseValue.html +1 -1
  269. package/docs/functions/StructProperty.Serialize.html +1 -1
  270. package/docs/functions/StructProperty.SerializeValue.html +1 -1
  271. package/docs/functions/StructSetProperty.Parse.html +1 -1
  272. package/docs/functions/StructSetProperty.Serialize.html +1 -1
  273. package/docs/functions/TextArrayProperty.Parse.html +1 -1
  274. package/docs/functions/TextArrayProperty.Serialize.html +1 -1
  275. package/docs/functions/TextProperty.CalcOverhead.html +1 -1
  276. package/docs/functions/TextProperty.Parse.html +1 -1
  277. package/docs/functions/TextProperty.ReadValue.html +1 -1
  278. package/docs/functions/TextProperty.Serialize.html +1 -1
  279. package/docs/functions/TextProperty.SerializeValue.html +1 -1
  280. package/docs/functions/Transform.Parse.html +1 -1
  281. package/docs/functions/Transform.ParseF.html +1 -1
  282. package/docs/functions/Transform.Serialize.html +1 -1
  283. package/docs/functions/Transform.SerializeF.html +1 -1
  284. package/docs/functions/Uint32Property.CalcOverhead.html +1 -1
  285. package/docs/functions/Uint32Property.Parse.html +1 -1
  286. package/docs/functions/Uint32Property.ReadValue.html +1 -1
  287. package/docs/functions/Uint32Property.Serialize.html +1 -1
  288. package/docs/functions/Uint32Property.SerializeValue.html +1 -1
  289. package/docs/functions/Uint32SetProperty.Parse.html +1 -1
  290. package/docs/functions/Uint32SetProperty.Serialize.html +1 -1
  291. package/docs/functions/Uint64Property.CalcOverhead.html +1 -1
  292. package/docs/functions/Uint64Property.Parse.html +1 -1
  293. package/docs/functions/Uint64Property.ReadValue.html +1 -1
  294. package/docs/functions/Uint64Property.Serialize.html +1 -1
  295. package/docs/functions/Uint64Property.SerializeValue.html +1 -1
  296. package/docs/functions/Uint8Property.CalcOverhead.html +1 -1
  297. package/docs/functions/Uint8Property.Parse.html +1 -1
  298. package/docs/functions/Uint8Property.ReadValue.html +1 -1
  299. package/docs/functions/Uint8Property.Serialize.html +1 -1
  300. package/docs/functions/Uint8Property.SerializeValue.html +1 -1
  301. package/docs/functions/VehiclePhysicsData.Parse.html +1 -1
  302. package/docs/functions/VehiclePhysicsData.Serialize.html +1 -1
  303. package/docs/functions/VehicleSpecialProperties.Parse.html +1 -1
  304. package/docs/functions/VehicleSpecialProperties.Serialize.html +1 -1
  305. package/docs/functions/col4.ParseBGRA.html +1 -1
  306. package/docs/functions/col4.ParseRGBA.html +1 -1
  307. package/docs/functions/col4.SerializeBGRA.html +1 -1
  308. package/docs/functions/col4.SerializeRGBA.html +1 -1
  309. package/docs/functions/isArrayProperty.html +1 -1
  310. package/docs/functions/isBoolArrayProperty.html +1 -1
  311. package/docs/functions/isBoolProperty.html +1 -1
  312. package/docs/functions/isBuildableSubsystemSpecialProperties.html +1 -1
  313. package/docs/functions/isByteArrayProperty.html +1 -1
  314. package/docs/functions/isByteProperty.html +1 -1
  315. package/docs/functions/isCircuitSpecialProperties.html +1 -1
  316. package/docs/functions/isConveyorChainActorSpecialProperties.html +1 -1
  317. package/docs/functions/isConveyorSpecialProperties.html +1 -1
  318. package/docs/functions/isDoubleArrayProperty.html +1 -1
  319. package/docs/functions/isDoubleProperty.html +1 -1
  320. package/docs/functions/isEmptySpecialProperties.html +1 -1
  321. package/docs/functions/isEnumArrayProperty.html +1 -1
  322. package/docs/functions/isEnumProperty.html +1 -1
  323. package/docs/functions/isFloatArrayProperty.html +1 -1
  324. package/docs/functions/isFloatProperty.html +1 -1
  325. package/docs/functions/isInt32ArrayProperty.html +1 -1
  326. package/docs/functions/isInt32Property.html +1 -1
  327. package/docs/functions/isInt32SetProperty.html +1 -1
  328. package/docs/functions/isInt64ArrayProperty.html +1 -1
  329. package/docs/functions/isInt64Property.html +1 -1
  330. package/docs/functions/isInt8Property.html +1 -1
  331. package/docs/functions/isMapProperty.html +1 -1
  332. package/docs/functions/isObjectArrayProperty.html +1 -1
  333. package/docs/functions/isObjectProperty.html +1 -1
  334. package/docs/functions/isObjectSetProperty.html +1 -1
  335. package/docs/functions/isObjectsListSpecialProperties.html +1 -1
  336. package/docs/functions/isPlayerSpecialProperties.html +1 -1
  337. package/docs/functions/isPowerLineSpecialProperties.html +1 -1
  338. package/docs/functions/isSaveComponent.html +1 -1
  339. package/docs/functions/isSaveEntity.html +1 -1
  340. package/docs/functions/isSetProperty.html +1 -1
  341. package/docs/functions/isSoftObjectArrayProperty.html +1 -1
  342. package/docs/functions/isSpecialDroneActionProperties.html +1 -1
  343. package/docs/functions/isStrArrayProperty.html +1 -1
  344. package/docs/functions/isStrProperty.html +1 -1
  345. package/docs/functions/isStrSetProperty.html +1 -1
  346. package/docs/functions/isStructArrayProperty.html +1 -1
  347. package/docs/functions/isStructProperty.html +1 -1
  348. package/docs/functions/isStructSetProperty.html +1 -1
  349. package/docs/functions/isTextArrayProperty.html +1 -1
  350. package/docs/functions/isTextProperty.html +1 -1
  351. package/docs/functions/isUInt64Property.html +1 -1
  352. package/docs/functions/isUint32Property.html +1 -1
  353. package/docs/functions/isUint32SetProperty.html +1 -1
  354. package/docs/functions/isUint8Property.html +1 -1
  355. package/docs/functions/isVehicleSpecialProperties.html +1 -1
  356. package/docs/functions/vec2.Parse.html +1 -1
  357. package/docs/functions/vec2.ParseF.html +1 -1
  358. package/docs/functions/vec2.Serialize.html +1 -1
  359. package/docs/functions/vec2.SerializeF.html +1 -1
  360. package/docs/functions/vec3.Parse.html +1 -1
  361. package/docs/functions/vec3.ParseF.html +1 -1
  362. package/docs/functions/vec3.ParseInt.html +1 -1
  363. package/docs/functions/vec3.Serialize.html +1 -1
  364. package/docs/functions/vec3.SerializeF.html +1 -1
  365. package/docs/functions/vec3.SerializeInt.html +1 -1
  366. package/docs/functions/vec3.add.html +1 -1
  367. package/docs/functions/vec3.length.html +1 -1
  368. package/docs/functions/vec3.mult.html +1 -1
  369. package/docs/functions/vec3.norm.html +1 -1
  370. package/docs/functions/vec3.sub.html +1 -1
  371. package/docs/functions/vec4.Parse.html +1 -1
  372. package/docs/functions/vec4.ParseF.html +1 -1
  373. package/docs/functions/vec4.Serialize.html +1 -1
  374. package/docs/functions/vec4.SerializeF.html +1 -1
  375. package/docs/index.html +4 -4
  376. package/docs/interfaces/Blueprint.html +2 -2
  377. package/docs/interfaces/BlueprintConfig-1.html +2 -2
  378. package/docs/interfaces/SaveComponentHeader.html +2 -2
  379. package/docs/interfaces/SaveEntityHeader.html +2 -2
  380. package/docs/interfaces/SaveObjectHeader.html +2 -2
  381. package/docs/modules/AbstractBaseProperty.html +1 -1
  382. package/docs/modules/ArrayProperty.html +1 -1
  383. package/docs/modules/BlueprintConfig.html +1 -1
  384. package/docs/modules/BlueprintHeader.html +1 -1
  385. package/docs/modules/BoolArrayProperty.html +1 -1
  386. package/docs/modules/BoolProperty.html +1 -1
  387. package/docs/modules/BuildableSubsystemSpecialProperties.html +1 -1
  388. package/docs/modules/BuildableTypeInstance.html +1 -1
  389. package/docs/modules/ByteArrayProperty.html +1 -1
  390. package/docs/modules/ByteProperty.html +1 -1
  391. package/docs/modules/CircuitSpecialProperties.html +1 -1
  392. package/docs/modules/ConveyorChainActorSpecialProperties.html +1 -1
  393. package/docs/modules/ConveyorSpecialProperties.html +1 -1
  394. package/docs/modules/DoubleArrayProperty.html +1 -1
  395. package/docs/modules/DoubleProperty.html +1 -1
  396. package/docs/modules/DynamicStructPropertyValue.html +1 -1
  397. package/docs/modules/EmptySpecialProperties.html +1 -1
  398. package/docs/modules/EnumArrayProperty.html +1 -1
  399. package/docs/modules/EnumProperty.html +1 -1
  400. package/docs/modules/FGDynamicStruct.html +1 -1
  401. package/docs/modules/FICFrameRange.html +1 -1
  402. package/docs/modules/FloatArrayProperty.html +1 -1
  403. package/docs/modules/FloatProperty.html +1 -1
  404. package/docs/modules/GUID.html +1 -1
  405. package/docs/modules/GUIDInfo.html +1 -1
  406. package/docs/modules/Int32ArrayProperty.html +1 -1
  407. package/docs/modules/Int32Property.html +1 -1
  408. package/docs/modules/Int32SetProperty.html +1 -1
  409. package/docs/modules/Int64ArrayProperty.html +1 -1
  410. package/docs/modules/Int64Property.html +1 -1
  411. package/docs/modules/Int8Property.html +1 -1
  412. package/docs/modules/Level.html +1 -1
  413. package/docs/modules/LevelToDestroyedActorsMap.html +3 -0
  414. package/docs/modules/MD5Hash.html +1 -1
  415. package/docs/modules/MapProperty.html +1 -1
  416. package/docs/modules/ObjectArrayProperty.html +1 -1
  417. package/docs/modules/ObjectProperty.html +1 -1
  418. package/docs/modules/ObjectReference.html +1 -1
  419. package/docs/modules/ObjectSetProperty.html +1 -1
  420. package/docs/modules/ObjectsListSpecialProperties.html +1 -1
  421. package/docs/modules/PlayerSpecialProperties.html +1 -1
  422. package/docs/modules/PowerLineSpecialProperties.html +1 -1
  423. package/docs/modules/PropertiesList.html +1 -1
  424. package/docs/modules/SatisfactorySaveHeader.html +1 -1
  425. package/docs/modules/SaveBodyChunks.html +1 -1
  426. package/docs/modules/SetProperty.html +1 -1
  427. package/docs/modules/SoftObjectArrayProperty.html +1 -1
  428. package/docs/modules/SoftObjectReference.html +1 -1
  429. package/docs/modules/SpecialDroneActionProperties.html +1 -1
  430. package/docs/modules/SpecialProperties.html +1 -1
  431. package/docs/modules/StrArrayProperty.html +1 -1
  432. package/docs/modules/StrProperty.html +1 -1
  433. package/docs/modules/StrSetProperty.html +1 -1
  434. package/docs/modules/StructArrayProperty.html +1 -1
  435. package/docs/modules/StructProperty.html +1 -1
  436. package/docs/modules/StructSetProperty.html +1 -1
  437. package/docs/modules/TextArrayProperty.html +1 -1
  438. package/docs/modules/TextProperty.html +1 -1
  439. package/docs/modules/Transform.html +1 -1
  440. package/docs/modules/Uint32Property.html +1 -1
  441. package/docs/modules/Uint32SetProperty.html +1 -1
  442. package/docs/modules/Uint64Property.html +1 -1
  443. package/docs/modules/Uint8Property.html +1 -1
  444. package/docs/modules/VehiclePhysicsData.html +1 -1
  445. package/docs/modules/VehicleSpecialProperties.html +1 -1
  446. package/docs/modules/col4.html +1 -1
  447. package/docs/modules/vec2.html +1 -1
  448. package/docs/modules/vec3.html +1 -1
  449. package/docs/modules/vec4.html +1 -1
  450. package/docs/modules.html +4 -2
  451. package/docs/types/AbstractBaseProperty-1.html +1 -1
  452. package/docs/types/ArrayProperty.AvailableArrayPropertyTypes.html +1 -1
  453. package/docs/types/ArrayPropertyStructValueFields.html +1 -1
  454. package/docs/types/BasicMultipleStructPropertyValue.html +1 -1
  455. package/docs/types/BasicStructPropertyValue.html +1 -1
  456. package/docs/types/BlueprintHeader-1.html +1 -1
  457. package/docs/types/BoolArrayProperty-1.html +1 -1
  458. package/docs/types/BoolProperty-1.html +1 -1
  459. package/docs/types/BoxStructPropertyValue.html +1 -1
  460. package/docs/types/BuildableSubsystemSpecialProperties-1.html +1 -1
  461. package/docs/types/BuildableTypeInstance-1.html +1 -1
  462. package/docs/types/ByteArray4.html +1 -1
  463. package/docs/types/ByteArrayProperty-1.html +1 -1
  464. package/docs/types/ByteProperty-1.html +1 -1
  465. package/docs/types/BytePropertyValue.html +1 -1
  466. package/docs/types/ChunkCompressionInfo.html +1 -1
  467. package/docs/types/ChunkSummary.html +1 -1
  468. package/docs/types/CircuitSpecialProperties-1.html +1 -1
  469. package/docs/types/ClientIdentityInfo.html +1 -1
  470. package/docs/types/ConveyorChainActorSpecialProperties-1.html +1 -1
  471. package/docs/types/ConveyorChainSegmentSpecialProperties.html +1 -1
  472. package/docs/types/ConveyorItemSpecialProperties.html +1 -1
  473. package/docs/types/ConveyorSpecialProperties-1.html +1 -1
  474. package/docs/types/DoubleArrayProperty-1.html +1 -1
  475. package/docs/types/DoubleProperty-1.html +1 -1
  476. package/docs/types/DynamicStructPropertyValue-1.html +1 -1
  477. package/docs/types/EmptySpecialProperties-1.html +1 -1
  478. package/docs/types/EnumArrayProperty-1.html +1 -1
  479. package/docs/types/EnumProperty-1.html +1 -1
  480. package/docs/types/FGDynamicStruct-1.html +1 -1
  481. package/docs/types/FICFrameRange-1.html +1 -1
  482. package/docs/types/FICFrameRangeStructPropertyValue.html +1 -1
  483. package/docs/types/FloatArrayProperty-1.html +1 -1
  484. package/docs/types/FloatProperty-1.html +1 -1
  485. package/docs/types/GENERIC_MAP_KEY_TYPE.html +1 -1
  486. package/docs/types/GENERIC_MAP_VALUE_TYPE.html +1 -1
  487. package/docs/types/GENERIC_STRUCT_PROPERTY_VALUE.html +1 -1
  488. package/docs/types/GUID-1.html +1 -1
  489. package/docs/types/GUIDInfo-1.html +1 -1
  490. package/docs/types/Grids.html +1 -1
  491. package/docs/types/Int32ArrayProperty-1.html +1 -1
  492. package/docs/types/Int32Property-1.html +1 -1
  493. package/docs/types/Int32SetProperty-1.html +1 -1
  494. package/docs/types/Int64ArrayProperty-1.html +1 -1
  495. package/docs/types/Int64Property-1.html +1 -1
  496. package/docs/types/Int8Property-1.html +1 -1
  497. package/docs/types/InventoryItemStructPropertyValue.html +1 -1
  498. package/docs/types/Level-1.html +2 -2
  499. package/docs/types/LevelToDestroyedActorsMap-1.html +1 -0
  500. package/docs/types/Levels.html +1 -1
  501. package/docs/types/MAP_STRUCT_KEY_PROXY.html +1 -1
  502. package/docs/types/MD5Hash-1.html +1 -1
  503. package/docs/types/MapProperty-1.html +1 -1
  504. package/docs/types/ModData.html +1 -1
  505. package/docs/types/ObjectArrayProperty-1.html +1 -1
  506. package/docs/types/ObjectProperty-1.html +1 -1
  507. package/docs/types/ObjectReference-1.html +1 -1
  508. package/docs/types/ObjectSetProperty-1.html +1 -1
  509. package/docs/types/ObjectsListSpecialProperties-1.html +1 -1
  510. package/docs/types/PlayerSpecialProperties-1.html +1 -1
  511. package/docs/types/PowerLineSpecialProperties-1.html +1 -1
  512. package/docs/types/PropertiesMap.html +1 -1
  513. package/docs/types/RailroadTrackPositionStructPropertyValue.html +1 -1
  514. package/docs/types/RoughSaveVersion.html +1 -1
  515. package/docs/types/SatisfactoryModMetadata.html +1 -1
  516. package/docs/types/SatisfactorySaveHeader-1.html +1 -1
  517. package/docs/types/SaveBodyChunks-1.html +1 -1
  518. package/docs/types/SaveBodyValidation.html +1 -1
  519. package/docs/types/SetProperty.AvailableSetPropertyTypes.html +1 -1
  520. package/docs/types/SoftObjectArrayProperty-1.html +1 -1
  521. package/docs/types/SoftObjectReference-1.html +1 -1
  522. package/docs/types/SpecialDroneAction.html +1 -1
  523. package/docs/types/SpecialDroneActionProperties-1.html +1 -1
  524. package/docs/types/SpecialProperties.AvailableSpecialPropertiesTypes.html +1 -1
  525. package/docs/types/StrArrayProperty-1.html +1 -1
  526. package/docs/types/StrProperty-1.html +1 -1
  527. package/docs/types/StrSetProperty-1.html +1 -1
  528. package/docs/types/StructArrayProperty-1.html +1 -1
  529. package/docs/types/StructProperty-1.html +1 -1
  530. package/docs/types/StructSetProperty-1.html +1 -1
  531. package/docs/types/TextArrayProperty-1.html +1 -1
  532. package/docs/types/TextProperty-1.html +1 -1
  533. package/docs/types/TextPropertyValue.html +1 -1
  534. package/docs/types/Transform-1.html +1 -1
  535. package/docs/types/Uint32Property-1.html +1 -1
  536. package/docs/types/Uint32SetProperty-1.html +1 -1
  537. package/docs/types/Uint64Property-1.html +1 -1
  538. package/docs/types/Uint8Property-1.html +1 -1
  539. package/docs/types/VehiclePhysicsData-1.html +1 -1
  540. package/docs/types/VehicleSpecialProperties-1.html +1 -1
  541. package/docs/types/col4-1.html +1 -1
  542. package/docs/types/vec2-1.html +1 -1
  543. package/docs/types/vec3-1.html +1 -1
  544. package/docs/types/vec4-1.html +1 -1
  545. package/docs/variables/DEFAULT_SATISFACTORY_CHUNK_HEADER_SIZE.html +1 -1
  546. package/docs/variables/EDIT.html +1 -1
  547. package/docs/variables/SaveBodyChunks.HEADER_V1.html +1 -1
  548. package/docs/variables/SaveBodyChunks.HEADER_V2.html +1 -1
  549. package/jsr.json +6 -0
  550. package/package.json +1 -3
@@ -0,0 +1,21 @@
1
+ name: Publish on JSR
2
+ on:
3
+ push:
4
+ tags:
5
+ - '*'
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ contents: read
12
+ id-token: write
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - name: Use Node.js
16
+ uses: actions/setup-node@v4
17
+ with:
18
+ node-version: '22.x'
19
+ cache: 'npm'
20
+ - run: npm ci
21
+ - run: npx jsr publish
@@ -1,4 +1,4 @@
1
- name: Tests
1
+ name: Run Tests
2
2
 
3
3
  on:
4
4
  push:
@@ -20,5 +20,6 @@ jobs:
20
20
  uses: actions/setup-node@v4
21
21
  with:
22
22
  node-version: ${{ matrix.node-version }}
23
+ cache: 'npm'
23
24
  - run: npm ci
24
25
  - run: npm test
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
-
2
1
  # Changelog
2
+ ### [3.0.3] (2025-08-08)
3
+ #### Internal Cleanup
4
+ * Renamed sample test saves to not include whitespaces.
5
+ * Made some function return types explicit instead of implicit.
6
+
7
+ ### [3.0.2] (2025-06-25)
8
+ #### Bugfix for Dismantled Crashsites and Map Markers
9
+ * Dismantled Crashsites weren't parsed correctly. They now correctly show up in the `destroyedActors` field of the persistent level.
10
+ * Map Markers weren't parsed correctly. They should be fixed now.
11
+
3
12
  ### [3.0.1] (2025-04-20)
4
13
  #### Breaking Changes in Save Structure for 1.1
5
14
  * The save header in 1.1 has now the save file name. Which gets used over the passed name when the file is from 1.1.
@@ -8,10 +17,10 @@
8
17
  * SaveObject's field `unknownType2` is now called `shouldMigrateObjectRefsToPersistent`.
9
18
  * SaveObject's field `objectVersion` is now called `saveCustomVersion`.
10
19
  * Levels also have a field `saveCustomVersion`.
11
- * `BuildableSubsystemSpecialProperties` have one more field (`currentLightweightVersion`) and their buildables can now be also a different type.
20
+ * `BuildableSubsystemSpecialProperties` have one more field (`currentLightweightVersion`).
12
21
  * The `parentObjectRoot` and `parentObjectName` got merged to `parentObject` as a Reference struct, instead of two strings.
13
22
  * The `objects` of `VehicleSpecialProperties` are now of type `VehiclePhysicsData` instead of just listing `unknownBytes`.
14
- * Levels within a Save are not an array, but an object with level name as key now.
23
+ * Levels within a Save are not an array, but an object with level name as key now. You can use `Object.values(levels)`to get your array.
15
24
  * Blueprint Configs have now a `configVersion`
16
25
  * InventoryItems' naming of fields changed. `itemStateRaw` is now better resolved into individual `properties`
17
26
  * InventoryItems have now a ObjectReference `itemReference` instead of the single string `itemName`, since that is more correct. InventoryItems' fields are also mostly optional due to compatibility.
@@ -21,7 +30,6 @@
21
30
  * `SatisfactorySaveHeader` and `BlueprintHeader` have their own namespace now.
22
31
 
23
32
 
24
- # Changelog
25
33
  ### [2.1.3] (2024-11-24)
26
34
  #### Update README
27
35
  * fixed link to auto-generated typedoc.
package/README.md CHANGED
@@ -39,7 +39,7 @@ If you parse a U8 save/blueprint, the parser will also serialize it back to a U8
39
39
  `yarn add @etothepii/satisfactory-file-parser`
40
40
 
41
41
  # Bug Reports or Feedback
42
- You can always raise an issue on the linked [github project](https://github.com/etothepii4/satisfactory-file-parser) or hit me up on the satisfactory discord `etothepii`.
42
+ You can always raise an issue on the linked [github project](https://github.com/etothepii4/satisfactory-file-parser) or hit me up in discord [`etothepii`](https://discordapp.com/users/268751901212803074).
43
43
 
44
44
  # Mod Support ✅
45
45
  By Default, most Mods just reuse Properties and Structs of the base game.
@@ -107,7 +107,7 @@ Parser.WriteSave(save, header => {
107
107
  });
108
108
 
109
109
  // write complete sav file back to disk
110
- fs.writeFileSync('./MyModifiedSave.sav', Buffer.concat([fileHeader!, ...bodyChunks]));
110
+ fs.writeFileSync('./MyModifiedSave.sav', new Uint8Array(Buffer.concat([fileHeader!, ...bodyChunks]));
111
111
  ```
112
112
 
113
113
 
@@ -146,10 +146,10 @@ const summary = Parser.WriteBlueprintFiles(blueprint,
146
146
  );
147
147
 
148
148
  // write complete .sbp file back to disk
149
- fs.writeFileSync('./MyBlueprint.sbp', Buffer.concat([mainFileHeader!, ...mainFileBodyChunks]));
149
+ fs.writeFileSync('./MyBlueprint.sbp', new Uint8Array(Buffer.concat([mainFileHeader!, ...mainFileBodyChunks])));
150
150
 
151
151
  // write .sbpcfg file back to disk, we get that data from the result of WriteBlueprintFiles
152
- fs.writeFileSync('./MyBlueprint.sbpcfg', Buffer.from(summary.configFileBinary));
152
+ fs.writeFileSync('./MyBlueprint.sbpcfg', new Uint8Array(summary.configFileBinary));
153
153
  ```
154
154
 
155
155
  ## Additional Options on the Parser Methods
@@ -243,7 +243,7 @@ const firstStack = inventoryStacks.values[0];
243
243
  ((firstStack.value as DynamicStructPropertyValue).properties.NumItems as Int32Property).value = 5;
244
244
 
245
245
  // modify original save object
246
- modifyObjects(firstContainer);
246
+ modifyObjects(inventory);
247
247
  ```
248
248
  # [Auto-Generated TypeDoc Reference](https://raw.githack.com/etothepii4/satisfactory-file-parser/main/docs/index.html).
249
249
 
@@ -252,4 +252,4 @@ More detailed explanation of some basic things in the parser.
252
252
 
253
253
  # [Changelog](https://github.com/etothepii4/satisfactory-file-parser/blob/main/CHANGELOG.md)
254
254
 
255
- # [Licence](https://github.com/etothepii4/satisfactory-file-parser/blob/main/LICENCE.md)
255
+ # [Licence](https://github.com/etothepii4/satisfactory-file-parser/blob/main/LICENCE.md)
package/build/index.d.ts CHANGED
@@ -3,7 +3,8 @@ export * from './parser/satisfactory/blueprint/blueprint-config-version';
3
3
  export * from './parser/satisfactory/blueprint/blueprint-header';
4
4
  export * from './parser/satisfactory/blueprint/blueprint.types';
5
5
  export * from './parser/satisfactory/save/factory-game-custom-version';
6
- export * from './parser/satisfactory/save/level.class';
6
+ export * from './parser/satisfactory/save/level';
7
+ export * from './parser/satisfactory/save/level-to-destroyed-actors-map';
7
8
  export * from './parser/satisfactory/save/satisfactory-save';
8
9
  export * from './parser/satisfactory/save/satisfactory-save-header';
9
10
  export * from './parser/satisfactory/save/save-body-chunks';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,kDAAkD,CAAC;AACjE,cAAc,0DAA0D,CAAC;AACzE,cAAc,kDAAkD,CAAC;AACjE,cAAc,iDAAiD,CAAC;AAChE,cAAc,wDAAwD,CAAC;AACvE,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,qDAAqD,CAAC;AACpE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,uCAAuC,CAAC;AACtD,cAAc,mDAAmD,CAAC;AAClE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mEAAmE,CAAC;AAClF,cAAc,0EAA0E,CAAC;AACzF,cAAc,8EAA8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AkF,CAAC;AACjG,cAAc,wEAAwE,CAAC;AACvF,cAAc,qEAAqE,CAAC;AACpF,cAAc,2EAA2E,CAAC;AAC1F,cAAc,sEAAsE,CAAC;AACrF,cAAc,yEAAyE,CAAC;AACxF,cAAc,sFAAsF,CAAC;AACrG,cAAc,2EAA2E,CAAC;AAC1F,cAAc,gEAAgE,CAAC;AAC/E,cAAc,uEAAuE,CAAC;AACtF,cAAc,0CAA0C,CAAC;AACzD,cAAc,gEAAgE,CAAC;AAC/E,cAAc,qDAAqD,CAAC;AACpE,cAAc,0CAA0C,CAAC;AACzD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,kEAAkE,CAAC;AACjF,cAAc,qDAAqD,CAAC;AACpE,cAAc,yDAAyD,CAAC;AACxE,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,0CAA0C,CAAC;AACzD,cAAc,wDAAwD,CAAC;AAGvE,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAC1G,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAC1G,cAAc,wCAAwC,CAAC;AACvD,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
@@ -20,7 +20,8 @@ __exportStar(require("./parser/satisfactory/blueprint/blueprint-config-version")
20
20
  __exportStar(require("./parser/satisfactory/blueprint/blueprint-header"), exports);
21
21
  __exportStar(require("./parser/satisfactory/blueprint/blueprint.types"), exports);
22
22
  __exportStar(require("./parser/satisfactory/save/factory-game-custom-version"), exports);
23
- __exportStar(require("./parser/satisfactory/save/level.class"), exports);
23
+ __exportStar(require("./parser/satisfactory/save/level"), exports);
24
+ __exportStar(require("./parser/satisfactory/save/level-to-destroyed-actors-map"), exports);
24
25
  __exportStar(require("./parser/satisfactory/save/satisfactory-save"), exports);
25
26
  __exportStar(require("./parser/satisfactory/save/satisfactory-save-header"), exports);
26
27
  __exportStar(require("./parser/satisfactory/save/save-body-chunks"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,mFAAiE;AACjE,2FAAyE;AACzE,mFAAiE;AACjE,kFAAgE;AAChE,yFAAuE;AACvE,yEAAuD;AACvD,+EAA6D;AAC7D,sFAAoE;AACpE,8EAA4D;AAC5D,iFAA+D;AAC/D,8EAA4D;AAC5D,wEAAsD;AACtD,oFAAkE;AAClE,iFAA+D;AAC/D,iFAA+D;AAC/D,oGAAkF;AAClF,2GAAyF;AACzF,+GAA6F;AAC7F,+GAA6F;AAC7F,iHAA+F;AAC/F,+GAA6F;AAC7F,gHAA8F;AAC9F,gHAA8F;AAC9F,gHAA8F;AAC9F,iHAA+F;AAC/F,qHAAmG;AACnG,8GAA4F;AAC5F,iHAA+F;AAC/F,+GAA6F;AAC7F,4FAA0E;AAC1E,4FAA0E;AAC1E,8FAA4E;AAC5E,4FAA0E;AAC1E,6FAA2E;AAC3E,6FAA2E;AAC3E,6FAA2E;AAC3E,4FAA0E;AAC1E,2FAAyE;AACzE,8FAA4E;AAC5E,4GAA0F;AAC1F,6GAA2F;AAC3F,uGAAqF;AACrF,0GAAwF;AACxF,6GAA2F;AAC3F,6GAA2F;AAC3F,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,uHAAqG;AACrG,4GAA0F;AAC1F,iGAA+E;AAC/E,wGAAsF;AACtF,2EAAyD;AACzD,iGAA+E;AAC/E,sFAAoE;AACpE,2EAAyD;AACzD,+EAA6D;AAC7D,8EAA4D;AAC5D,mGAAiF;AACjF,sFAAoE;AACpE,0FAAwE;AACxE,gFAA8D;AAC9D,2EAAyD;AACzD,2EAAyD;AACzD,2EAAyD;AACzD,yFAAuE;AAGvE,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,yEAAuD;AACvD,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-config';\nexport * from './parser/satisfactory/blueprint/blueprint-config-version';\nexport * from './parser/satisfactory/blueprint/blueprint-header';\nexport * from './parser/satisfactory/blueprint/blueprint.types';\nexport * from './parser/satisfactory/save/factory-game-custom-version';\nexport * from './parser/satisfactory/save/level.class';\nexport * from './parser/satisfactory/save/satisfactory-save';\nexport * from './parser/satisfactory/save/satisfactory-save-header';\nexport * from './parser/satisfactory/save/save-body-chunks';\nexport * from './parser/satisfactory/save/save-custom-version';\nexport * from './parser/satisfactory/save/save-header-type';\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/objects/SaveObject';\nexport * from './parser/satisfactory/types/property/generic/AbstractBaseProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty';\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/Int32SetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/SetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/StrSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/StructSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty';\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/runtime-buildable-instance-data-version';\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/FGDynamicStruct';\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';\nexport * from './parser/satisfactory/types/structs/VehiclePhysicsData';\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 * 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\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,mFAAiE;AACjE,2FAAyE;AACzE,mFAAiE;AACjE,kFAAgE;AAChE,yFAAuE;AACvE,mEAAiD;AACjD,2FAAyE;AACzE,+EAA6D;AAC7D,sFAAoE;AACpE,8EAA4D;AAC5D,iFAA+D;AAC/D,8EAA4D;AAC5D,wEAAsD;AACtD,oFAAkE;AAClE,iFAA+D;AAC/D,iFAA+D;AAC/D,oGAAkF;AAClF,2GAAyF;AACzF,+GAA6F;AAC7F,+GAA6F;AAC7F,iHAA+F;AAC/F,+GAA6F;AAC7F,gHAA8F;AAC9F,gHAA8F;AAC9F,gHAA8F;AAC9F,iHAA+F;AAC/F,qHAAmG;AACnG,8GAA4F;AAC5F,iHAA+F;AAC/F,+GAA6F;AAC7F,4FAA0E;AAC1E,4FAA0E;AAC1E,8FAA4E;AAC5E,4FAA0E;AAC1E,6FAA2E;AAC3E,6FAA2E;AAC3E,6FAA2E;AAC3E,4FAA0E;AAC1E,2FAAyE;AACzE,8FAA4E;AAC5E,4GAA0F;AAC1F,6GAA2F;AAC3F,uGAAqF;AACrF,0GAAwF;AACxF,6GAA2F;AAC3F,6GAA2F;AAC3F,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,uHAAqG;AACrG,4GAA0F;AAC1F,iGAA+E;AAC/E,wGAAsF;AACtF,2EAAyD;AACzD,iGAA+E;AAC/E,sFAAoE;AACpE,2EAAyD;AACzD,+EAA6D;AAC7D,8EAA4D;AAC5D,mGAAiF;AACjF,sFAAoE;AACpE,0FAAwE;AACxE,gFAA8D;AAC9D,2EAAyD;AACzD,2EAAyD;AACzD,2EAAyD;AACzD,yFAAuE;AAGvE,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,yEAAuD;AACvD,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-config';\nexport * from './parser/satisfactory/blueprint/blueprint-config-version';\nexport * from './parser/satisfactory/blueprint/blueprint-header';\nexport * from './parser/satisfactory/blueprint/blueprint.types';\nexport * from './parser/satisfactory/save/factory-game-custom-version';\nexport * from './parser/satisfactory/save/level';\nexport * from './parser/satisfactory/save/level-to-destroyed-actors-map';\nexport * from './parser/satisfactory/save/satisfactory-save';\nexport * from './parser/satisfactory/save/satisfactory-save-header';\nexport * from './parser/satisfactory/save/save-body-chunks';\nexport * from './parser/satisfactory/save/save-custom-version';\nexport * from './parser/satisfactory/save/save-header-type';\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/objects/SaveObject';\nexport * from './parser/satisfactory/types/property/generic/AbstractBaseProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty';\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/Int32SetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/SetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/StrSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/StructSetProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty';\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/runtime-buildable-instance-data-version';\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/FGDynamicStruct';\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';\nexport * from './parser/satisfactory/types/structs/VehiclePhysicsData';\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 * 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\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAQpE,qBAAa,MAAM;WASJ,SAAS,CACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,eAAe,EACtB,OAAO,CAAC,EAAE,OAAO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,SAAS;IAoCZ,OAAc,qBAAqB,QAAS,GAAG,WAAU,MAAM,KAAO,MAAM,CAQjE;CAEX"}
@@ -54,9 +54,11 @@ class Parser {
54
54
  save_writer_1.SaveWriter.WriteGrids(writer, save.grids);
55
55
  }
56
56
  save_writer_1.SaveWriter.WriteLevels(writer, save);
57
- writer.writeInt32(save.unresolvedWorldSaveData?.length ?? 0);
58
- for (const actor of save.unresolvedWorldSaveData ?? []) {
59
- ObjectReference_1.ObjectReference.write(writer, actor);
57
+ if (save.unresolvedWorldSaveData && save.unresolvedWorldSaveData.length > 0) {
58
+ writer.writeInt32(save.unresolvedWorldSaveData?.length ?? 0);
59
+ for (const actor of save.unresolvedWorldSaveData ?? []) {
60
+ ObjectReference_1.ObjectReference.write(writer, actor);
61
+ }
60
62
  }
61
63
  writer.endWriting();
62
64
  const chunkSummary = writer.generateChunks(save.compressionInfo, posAfterHeader, options?.onBinaryBeforeCompressing ?? (() => { }), onHeader, onChunk);
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAC/D,gFAA4E;AAC5E,gFAA4E;AAC5E,gFAAmG;AACnG,gFAAmG;AAEnG,6EAAyE;AACzE,2FAAsF;AAEtF,iFAA4E;AAC5E,iEAA6D;AAC7D,iEAA6D;AAC7D,kFAA+E;AAI/E,MAAa,MAAM;IASX,MAAM,CAAC,SAAS,CACtB,IAAY,EACZ,KAAsB,EACtB,OAGE;QAGF,MAAM,MAAM,GAAG,IAAI,wBAAU,CAAC,KAAK,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,iDAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,IAAI,GAAG,IAAI,oCAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAGhD,MAAM,gBAAgB,GAAG,wBAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,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AAK,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 { BlueprintConfig } from './satisfactory/blueprint/blueprint-config';\nimport { BlueprintHeader } from './satisfactory/blueprint/blueprint-header';\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 { SatisfactorySaveHeader } from './satisfactory/save/satisfactory-save-header';\nimport { ChunkSummary } from './satisfactory/save/save-body-chunks';\nimport { SaveCustomVersion } from './satisfactory/save/save-custom-version';\nimport { SaveReader } from './satisfactory/save/save-reader';\nimport { SaveWriter } from \"./satisfactory/save/save-writer\";\nimport { ObjectReference } from './satisfactory/types/structs/ObjectReference';\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: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBufferLike) => void,\n\t\t\tonProgressCallback: (progress: number, msg?: string) => void\n\t\t}>\n\t): SatisfactorySave {\n\n\t\tconst reader = new SaveReader(bytes, options?.onProgressCallback);\n\n\t\tconst header = SatisfactorySaveHeader.Parse(reader);\n\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t}\n\n\t\t// inflate chunks\n\t\tconst inflateResult = reader.inflateChunks();\n\t\tsave.compressionInfo = inflateResult.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\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\n\t\t\t// save body validation hash\n\t\t\tsave.gridHash = reader.readSaveBodyHash();\n\n\t\t\t// parse grids\n\t\t\tsave.grids = reader.readGrids();\n\t\t}\n\n\n\t\t// parse levels\n\t\tsave.levels = reader.readLevels();\n\n\t\t// unresolved data, probably not even useful.\n\t\tconst countUnresolvedWorldSaveData = reader.readInt32();\n\t\tif (countUnresolvedWorldSaveData) {\n\t\t\tsave.unresolvedWorldSaveData = [];\n\t\t\tfor (let i = 0; i < countUnresolvedWorldSaveData; i++) {\n\t\t\t\tsave.unresolvedWorldSaveData.push(ObjectReference.read(reader));\n\t\t\t}\n\t\t}\n\n\t\treader.onProgressCallback(reader.getBufferProgress(), 'finished parsing.');\n\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\t\twriter.context.saveHeaderType = save.header.saveHeaderType;\n\t\twriter.context.saveVersion = save.header.saveVersion;\n\t\twriter.context.buildVersion = save.header.buildVersion;\n\t\twriter.context.mapName = save.header.mapName;\n\n\t\tSatisfactorySaveHeader.Serialize(writer, save.header);\n\t\tconst posAfterHeader = writer.getBufferPosition();\n\n\t\tif (writer.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\tSaveWriter.WriteSaveBodyHash(writer, save.gridHash);\n\t\t\tSaveWriter.WriteGrids(writer, save.grids);\n\t\t}\n\n\t\tSaveWriter.WriteLevels(writer, save);\n\n\t\t// unresolved data\n\t\twriter.writeInt32(save.unresolvedWorldSaveData?.length ?? 0);\n\t\tfor (const actor of save.unresolvedWorldSaveData ?? []) {\n\t\t\tObjectReference.write(writer, actor);\n\t\t}\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.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintHeader.Serialize(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\tconfigWriter.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintConfig.Serialize(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: ArrayBufferLike,\n\t\tblueprintConfigFile: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedBlueprintBody: (buffer: ArrayBufferLike) => void\n\t\t}>\n\t): Blueprint {\n\n\t\t// read config file\n\t\tconst blueprintConfigReader = new BlueprintConfigReader(blueprintConfigFile);\n\t\tconst config = BlueprintConfig.Parse(blueprintConfigReader);\n\n\t\t// read actual blueprint file. with context from config\n\t\tconst blueprintReader = new BlueprintReader(blueprintFile);\n\t\tblueprintReader.context.blueprintConfigVersion = config.configVersion;\n\t\tconst header = BlueprintHeader.Parse(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
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAC/D,gFAA4E;AAC5E,gFAA4E;AAC5E,gFAAmG;AACnG,gFAAmG;AAEnG,6EAAyE;AACzE,2FAAsF;AAEtF,iFAA4E;AAC5E,iEAA6D;AAC7D,iEAA6D;AAC7D,kFAA+E;AAI/E,MAAa,MAAM;IASX,MAAM,CAAC,SAAS,CACtB,IAAY,EACZ,KAAsB,EACtB,OAGE;QAGF,MAAM,MAAM,GAAG,IAAI,wBAAU,CAAC,KAAK,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,iDAAsB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,IAAI,GAAG,IAAI,oCAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAGhD,MAAM,gBAAgB,GAAG,wBAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5E,IAAI,gBAAgB,KAAK,KAAK,EAAE,CAAC;YAChC,MAAM,IAAI,sCAAuB,CAAC,iGAAiG,CAAC,CAAC;QACtI,CAAC;QAGD,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAC7C,IAAI,CAAC,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC;QAGrD,IAAI,OAAO,EAAE,sBAAsB,KAAK,SAAS,EAAE,CAAC;YACnD,OAAO,CAAC,sBAAsB,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,IAAI,uCAAiB,CAAC,wBAAwB,EAAE,CAAC;YAG9E,IAAI,CAAC,QAAQ,GA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AAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAG5D,MAAM,eAAe,GAAG,IAAI,kCAAe,CAAC,aAAa,CAAC,CAAC;QAC3D,eAAe,CAAC,OAAO,CAAC,sBAAsB,GAAG,MAAM,CAAC,aAAa,CAAC;QACtE,MAAM,MAAM,GAAG,kCAAe,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QACtD,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;;AAjNF,wBAqOC;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 { BlueprintConfig } from './satisfactory/blueprint/blueprint-config';\nimport { BlueprintHeader } from './satisfactory/blueprint/blueprint-header';\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 { SatisfactorySaveHeader } from './satisfactory/save/satisfactory-save-header';\nimport { ChunkSummary } from './satisfactory/save/save-body-chunks';\nimport { SaveCustomVersion } from './satisfactory/save/save-custom-version';\nimport { SaveReader } from './satisfactory/save/save-reader';\nimport { SaveWriter } from \"./satisfactory/save/save-writer\";\nimport { ObjectReference } from './satisfactory/types/structs/ObjectReference';\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: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBufferLike) => void,\n\t\t\tonProgressCallback: (progress: number, msg?: string) => void\n\t\t}>\n\t): SatisfactorySave {\n\n\t\tconst reader = new SaveReader(bytes, options?.onProgressCallback);\n\n\t\tconst header = SatisfactorySaveHeader.Parse(reader);\n\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported in the parser. Please save the file in a newer game version.');\n\t\t}\n\n\t\t// inflate chunks\n\t\tconst inflateResult = reader.inflateChunks();\n\t\tsave.compressionInfo = inflateResult.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\tif (reader.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\n\t\t\t// save body validation hash\n\t\t\tsave.gridHash = reader.readSaveBodyHash();\n\n\t\t\t// parse grids\n\t\t\tsave.grids = reader.readGrids();\n\t\t}\n\n\n\t\t// parse levels\n\t\tsave.levels = reader.readLevels();\n\n\t\t// unresolved data, probably not even useful.\n\t\tconst countUnresolvedWorldSaveData = reader.readInt32();\n\t\tif (countUnresolvedWorldSaveData) {\n\t\t\tsave.unresolvedWorldSaveData = [];\n\t\t\tfor (let i = 0; i < countUnresolvedWorldSaveData; i++) {\n\t\t\t\tsave.unresolvedWorldSaveData.push(ObjectReference.read(reader));\n\t\t\t}\n\t\t}\n\n\t\treader.onProgressCallback(reader.getBufferProgress(), 'finished parsing.');\n\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\t\twriter.context.saveHeaderType = save.header.saveHeaderType;\n\t\twriter.context.saveVersion = save.header.saveVersion;\n\t\twriter.context.buildVersion = save.header.buildVersion;\n\t\twriter.context.mapName = save.header.mapName;\n\n\t\tSatisfactorySaveHeader.Serialize(writer, save.header);\n\t\tconst posAfterHeader = writer.getBufferPosition();\n\n\t\tif (writer.context.saveVersion >= SaveCustomVersion.IntroducedWorldPartition) {\n\t\t\tSaveWriter.WriteSaveBodyHash(writer, save.gridHash);\n\t\t\tSaveWriter.WriteGrids(writer, save.grids);\n\t\t}\n\n\t\tSaveWriter.WriteLevels(writer, save);\n\n\t\t// unresolved data\n\t\t// TODO: check if we ever encounter it.\n\t\tif (save.unresolvedWorldSaveData && save.unresolvedWorldSaveData.length > 0) {\n\t\t\twriter.writeInt32(save.unresolvedWorldSaveData?.length ?? 0);\n\t\t\tfor (const actor of save.unresolvedWorldSaveData ?? []) {\n\t\t\t\tObjectReference.write(writer, actor);\n\t\t\t}\n\t\t}\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.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintHeader.Serialize(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\tconfigWriter.context.blueprintConfigVersion = blueprint.config.configVersion;\n\t\tblueprintWriter.context.saveVersion = blueprint.header.saveVersion;\n\t\tblueprintWriter.context.buildVersion = blueprint.header.buildVersion;\n\n\t\tBlueprintConfig.Serialize(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: ArrayBufferLike,\n\t\tblueprintConfigFile: ArrayBufferLike,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedBlueprintBody: (buffer: ArrayBufferLike) => void\n\t\t}>\n\t): Blueprint {\n\n\t\t// read config file\n\t\tconst blueprintConfigReader = new BlueprintConfigReader(blueprintConfigFile);\n\t\tconst config = BlueprintConfig.Parse(blueprintConfigReader);\n\n\t\t// read actual blueprint file. with context from config\n\t\tconst blueprintReader = new BlueprintReader(blueprintFile);\n\t\tblueprintReader.context.blueprintConfigVersion = config.configVersion;\n\t\tconst header = BlueprintHeader.Parse(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 +1 @@
1
- {"version":3,"file":"blueprint-config.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAK7C,MAAM,WAAW,eAAe;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,IAAI,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;CACP;AAED,yBAAiB,eAAe,CAAC;IACtB,MAAM,KAAK,WAAY,aAAa,oBAgC1C,CAAC;IAEK,MAAM,SAAS,WAAY,aAAa,UAAU,eAAe,SAmBvE,CAAA;CACJ"}
1
+ {"version":3,"file":"blueprint-config.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAK7C,MAAM,WAAW,eAAe;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,IAAI,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE;QACX,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,YAAY,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;CACP;AAED,yBAAiB,eAAe,CAAC;IACtB,MAAM,KAAK,WAAY,aAAa,KAAG,eAgC7C,CAAC;IAEK,MAAM,SAAS,WAAY,aAAa,UAAU,eAAe,KAAG,IAmB1E,CAAA;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"blueprint-config.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-config.ts"],"names":[],"mappings":";;;AAEA,gDAA6C;AAC7C,yEAAoE;AAkBpE,IAAiB,eAAe,CAuD/B;AAvDD,WAAiB,eAAe;IACf,qBAAK,GAAG,CAAC,MAAqB,EAAE,EAAE;QAC3C,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QACzC,MAAM,WAAW,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACxC,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,WAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACrC,MAAM,CAAC,OAAO,CAAC,sBAAsB,GAAG,aAAa,CAAC;QAEtD,MAAM,MAAM,GAAoB;YAC5B,aAAa;YACb,WAAW;YACX,KAAK;YACL,MAAM;SACT,CAAC;QAEF,IAAI,aAAa,IAAI,iDAAsB,CAAC,oBAAoB,EAAE,CAAC;YAC/D,MAAM,CAAC,qBAAqB,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;YACnD,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACjD,CAAC;QAED,IAAI,aAAa,IAAI,iDAAsB,CAAC,iBAAiB,EAAE,CAAC;YAC5D,MAAM,KAAK,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC;YACjC,MAAM,CAAC,YAAY,GAAG,EAAE,CAAC;YACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC7B,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC;oBACtB,SAAS,EAAE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'../../context/context-reader';\nimport { ContextWriter } from '../../context/context-writer';\nimport { col4 } from '../types/structs/col4';\nimport { BlueprintConfigVersion } from './blueprint-config-version';\n\n\n/** @public */\nexport interface BlueprintConfig {\n configVersion: number;\n description: string;\n color: col4;\n iconID: number;\n referencedIconLibrary?: string;\n iconLibraryType?: string;\n lastEditedBy?: {\n accountId: string;\n displayName: string;\n platformName: string;\n }[];\n}\n\nexport namespace BlueprintConfig {\n export const Parse = (reader: ContextReader) => {\n const configVersion = reader.readInt32();\n const description = reader.readString();\n const iconID = reader.readInt32();\n const color = col4.ParseRGBA(reader);\n reader.context.blueprintConfigVersion = configVersion;\n\n const config: BlueprintConfig = {\n configVersion,\n description,\n color,\n iconID,\n };\n\n if (configVersion >= BlueprintConfigVersion.AddedIconLibraryPath) {\n config.referencedIconLibrary = reader.readString();\n config.iconLibraryType = reader.readString();\n }\n\n if (configVersion >= BlueprintConfigVersion.AddedLastEditedBy) {\n const count = reader.readInt32();\n config.lastEditedBy = [];\n for (let i = 0; i < count; i++) {\n config.lastEditedBy?.push({\n accountId: reader.readString(),\n displayName: reader.readString(),\n platformName: reader.readString()\n });\n }\n }\n\n return config;\n };\n\n export const Serialize = (writer: ContextWriter, config: BlueprintConfig) => {\n writer.writeInt32(config.configVersion);\n writer.writeString(config.description);\n writer.writeInt32(config.iconID);\n col4.SerializeRGBA(writer, config.color);\n\n if (config.configVersion >= BlueprintConfigVersion.AddedIconLibraryPath) {\n writer.writeString(config.referencedIconLibrary ?? '');\n writer.writeString(config.iconLibraryType ?? '');\n }\n\n if (config.configVersion >= BlueprintConfigVersion.AddedLastEditedBy) {\n writer.writeInt32(config.lastEditedBy!.length);\n for (const account of config.lastEditedBy!) {\n writer.writeString(account.accountId);\n writer.writeString(account.displayName);\n writer.writeString(account.platformName);\n }\n }\n }\n}"]}
1
+ {"version":3,"file":"blueprint-config.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-config.ts"],"names":[],"mappings":";;;AAEA,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EAAQ,EAAE;QAC9E,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QACxC,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QACvC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACjC,WAAI,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAEzC,IAAI,MAAM,CAAC,aAAa,IAAI,iDAAsB,CAAC,oBAAoB,EAAE,CAAC;YACtE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,qBAAqB,IAAI,EAAE,CAAC,CAAC;YACvD,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,IAAI,MAAM,CAAC,aAAa,IAAI,iDAAsB,CAAC,iBAAiB,EAAE,CAAC;YACnE,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,YAAa,CAAC,MAAM,CAAC,CAAC;YAC/C,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,YAAa,EAAE,CAAC;gBACzC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;gBACtC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;gBACxC,MAAM,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAC7C,CAAC;QACL,CAAC;IACL,CAAC,CAAA;AACL,CAAC,EAvDgB,eAAe,+BAAf,eAAe,QAuD/B","sourcesContent":["import { ContextReader } from '../../context/context-reader';\nimport { ContextWriter } from '../../context/context-writer';\nimport { col4 } from '../types/structs/col4';\nimport { BlueprintConfigVersion } from './blueprint-config-version';\n\n\n/** @public */\nexport interface BlueprintConfig {\n configVersion: number;\n description: string;\n color: col4;\n iconID: number;\n referencedIconLibrary?: string;\n iconLibraryType?: string;\n lastEditedBy?: {\n accountId: string;\n displayName: string;\n platformName: string;\n }[];\n}\n\nexport namespace BlueprintConfig {\n export const Parse = (reader: ContextReader): BlueprintConfig => {\n const configVersion = reader.readInt32();\n const description = reader.readString();\n const iconID = reader.readInt32();\n const color = col4.ParseRGBA(reader);\n reader.context.blueprintConfigVersion = configVersion;\n\n const config: BlueprintConfig = {\n configVersion,\n description,\n color,\n iconID,\n };\n\n if (configVersion >= BlueprintConfigVersion.AddedIconLibraryPath) {\n config.referencedIconLibrary = reader.readString();\n config.iconLibraryType = reader.readString();\n }\n\n if (configVersion >= BlueprintConfigVersion.AddedLastEditedBy) {\n const count = reader.readInt32();\n config.lastEditedBy = [];\n for (let i = 0; i < count; i++) {\n config.lastEditedBy?.push({\n accountId: reader.readString(),\n displayName: reader.readString(),\n platformName: reader.readString()\n });\n }\n }\n\n return config;\n };\n\n export const Serialize = (writer: ContextWriter, config: BlueprintConfig): void => {\n writer.writeInt32(config.configVersion);\n writer.writeString(config.description);\n writer.writeInt32(config.iconID);\n col4.SerializeRGBA(writer, config.color);\n\n if (config.configVersion >= BlueprintConfigVersion.AddedIconLibraryPath) {\n writer.writeString(config.referencedIconLibrary ?? '');\n writer.writeString(config.iconLibraryType ?? '');\n }\n\n if (config.configVersion >= BlueprintConfigVersion.AddedLastEditedBy) {\n writer.writeInt32(config.lastEditedBy!.length);\n for (const account of config.lastEditedBy!) {\n writer.writeString(account.accountId);\n writer.writeString(account.displayName);\n writer.writeString(account.platformName);\n }\n }\n }\n}"]}
@@ -11,14 +11,7 @@ export type BlueprintHeader = {
11
11
  recipeReferences: ObjectReference[];
12
12
  };
13
13
  export declare namespace BlueprintHeader {
14
- const Parse: (reader: ContextReader) => {
15
- headerVersion: number;
16
- saveVersion: number;
17
- buildVersion: number;
18
- designerDimension: vec3;
19
- recipeReferences: ObjectReference[];
20
- itemCosts: [ObjectReference, number][];
21
- };
14
+ const Parse: (reader: ContextReader) => BlueprintHeader;
22
15
  const Serialize: (writer: ContextWriter, header: BlueprintHeader) => void;
23
16
  }
24
17
  //# sourceMappingURL=blueprint-header.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"blueprint-header.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAG7C,MAAM,MAAM,eAAe,GAAG;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,IAAI,CAAC;IACzB,SAAS,EAAE,CAAC,eAAe,EAAE,MAAM,CAAC,EAAE,CAAC;IACvC,gBAAgB,EAAE,eAAe,EAAE,CAAC;CACvC,CAAA;AAED,yBAAiB,eAAe,CAAC;IAEtB,MAAM,KAAK,WAAY,aAAa;;;;;;;KAwC1C,CAAA;IAEM,MAAM,SAAS,WAAY,aAAa,UAAU,eAAe,SA4BvE,CAAA;CACJ"}
1
+ {"version":3,"file":"blueprint-header.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAG7C,MAAM,MAAM,eAAe,GAAG;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,IAAI,CAAC;IACzB,SAA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,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAGjC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC3C,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACtC,iCAAe,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAA;YAC1C,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,CAAC;QAGD,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAClD,KAAK,MAAM,eAAe,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;YACpD,iCAAe,CAAC,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QACnD,CAAC;IACL,CAAC,CAAA;AACL,CAAC,EAzEgB,eAAe,+BAAf,eAAe,QAyE/B","sourcesContent":["import { ContextReader } from '../../context/context-reader';\nimport { ContextWriter } from '../../context/context-writer';\nimport { ObjectReference } from '../types/structs/ObjectReference';\nimport { vec3 } from '../types/structs/vec3';\n\n/** @public */\nexport type BlueprintHeader = {\n headerVersion: number,\n saveVersion: number,\n buildVersion: number,\n designerDimension?: vec3;\n itemCosts: [ObjectReference, number][];\n recipeReferences: ObjectReference[];\n}\n\nexport namespace BlueprintHeader {\n\n export const Parse = (reader: ContextReader) => {\n\n const headerVersion = reader.readInt32();\n const saveVersion = reader.readInt32();\n const buildVersion = reader.readInt32();\n const dimensions = vec3.ParseInt(reader); // e.g. 4,4,4 - dimensions in foundation size\n\n // set context\n reader.context.headerVersion = headerVersion;\n reader.context.saveVersion = saveVersion;\n reader.context.buildVersion = buildVersion;\n\n\n // list of item costs.\n let itemTypeCount = reader.readInt32();\n const itemCosts = new Array<[ObjectReference, number]>(itemTypeCount).fill([{ levelName: '', pathName: '' }, 0]);\n for (let i = 0; i < itemTypeCount; i++) {\n let itemPathName = ObjectReference.read(reader);\n let itemCount = reader.readInt32();\n\n itemCosts[i] = [itemPathName, itemCount];\n }\n\n // list of recipes\n let recipeCount = reader.readInt32();\n const recipeRefs = new Array<ObjectReference>(recipeCount).fill({ levelName: '', pathName: '' });\n for (let i = 0; i < recipeCount; i++) {\n const recipeName = ObjectReference.read(reader);\n recipeRefs[i] = recipeName;\n }\n\n return {\n headerVersion,\n saveVersion,\n buildVersion,\n designerDimension: dimensions,\n recipeReferences: recipeRefs,\n itemCosts\n } satisfies BlueprintHeader;\n\n }\n\n export const Serialize = (writer: ContextWriter, header: BlueprintHeader) => {\n\n writer.writeInt32(header.headerVersion);\n writer.writeInt32(header.saveVersion);\n writer.writeInt32(header.buildVersion);\n\n // we assume a minimum of 4 foundations dimensions, standard blueprint designer.\n let dimensions = [\n header.designerDimension?.x ?? 4,\n header.designerDimension?.y ?? 4,\n header.designerDimension?.z ?? 4,\n ].map(dim => dim < 4 ? 4 : dim);\n writer.writeInt32(dimensions[0]);\n writer.writeInt32(dimensions[1]);\n writer.writeInt32(dimensions[2]);\n\n // list of item costs.\n writer.writeInt32(header.itemCosts.length);\n for (const itemCost of header.itemCosts) {\n ObjectReference.write(writer, itemCost[0])\n writer.writeInt32(itemCost[1]);\n }\n\n // list of recipes.\n writer.writeInt32(header.recipeReferences.length);\n for (const recipeReference of header.recipeReferences) {\n ObjectReference.write(writer, recipeReference);\n }\n }\n}"]}
1
+ {"version":3,"file":"blueprint-header.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-header.ts"],"names":[],"mappings":";;;AAEA,sEAAmE;AACnE,gDAA6C;AAY7C,IAAiB,eAAe,CAyE/B;AAzED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AAC,CAAC,CAAC,CAAA;YAC1C,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,CAAC;QAGD,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAClD,KAAK,MAAM,eAAe,IAAI,MAAM,CAAC,gBAAgB,EAAE,CAAC;YACpD,iCAAe,CAAC,KAAK,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QACnD,CAAC;IACL,CAAC,CAAA;AACL,CAAC,EAzEgB,eAAe,+BAAf,eAAe,QAyE/B","sourcesContent":["import { ContextReader } from '../../context/context-reader';\nimport { ContextWriter } from '../../context/context-writer';\nimport { ObjectReference } from '../types/structs/ObjectReference';\nimport { vec3 } from '../types/structs/vec3';\n\n/** @public */\nexport type BlueprintHeader = {\n headerVersion: number,\n saveVersion: number,\n buildVersion: number,\n designerDimension?: vec3;\n itemCosts: [ObjectReference, number][];\n recipeReferences: ObjectReference[];\n}\n\nexport namespace BlueprintHeader {\n\n export const Parse = (reader: ContextReader): BlueprintHeader => {\n\n const headerVersion = reader.readInt32();\n const saveVersion = reader.readInt32();\n const buildVersion = reader.readInt32();\n const dimensions = vec3.ParseInt(reader); // e.g. 4,4,4 - dimensions in foundation size\n\n // set context\n reader.context.headerVersion = headerVersion;\n reader.context.saveVersion = saveVersion;\n reader.context.buildVersion = buildVersion;\n\n\n // list of item costs.\n let itemTypeCount = reader.readInt32();\n const itemCosts = new Array<[ObjectReference, number]>(itemTypeCount).fill([{ levelName: '', pathName: '' }, 0]);\n for (let i = 0; i < itemTypeCount; i++) {\n let itemPathName = ObjectReference.read(reader);\n let itemCount = reader.readInt32();\n\n itemCosts[i] = [itemPathName, itemCount];\n }\n\n // list of recipes\n let recipeCount = reader.readInt32();\n const recipeRefs = new Array<ObjectReference>(recipeCount).fill({ levelName: '', pathName: '' });\n for (let i = 0; i < recipeCount; i++) {\n const recipeName = ObjectReference.read(reader);\n recipeRefs[i] = recipeName;\n }\n\n return {\n headerVersion,\n saveVersion,\n buildVersion,\n designerDimension: dimensions,\n recipeReferences: recipeRefs,\n itemCosts\n } satisfies BlueprintHeader;\n\n }\n\n export const Serialize = (writer: ContextWriter, header: BlueprintHeader): void => {\n\n writer.writeInt32(header.headerVersion);\n writer.writeInt32(header.saveVersion);\n writer.writeInt32(header.buildVersion);\n\n // we assume a minimum of 4 foundations dimensions, standard blueprint designer.\n let dimensions = [\n header.designerDimension?.x ?? 4,\n header.designerDimension?.y ?? 4,\n header.designerDimension?.z ?? 4,\n ].map(dim => dim < 4 ? 4 : dim);\n writer.writeInt32(dimensions[0]);\n writer.writeInt32(dimensions[1]);\n writer.writeInt32(dimensions[2]);\n\n // list of item costs.\n writer.writeInt32(header.itemCosts.length);\n for (const itemCost of header.itemCosts) {\n ObjectReference.write(writer, itemCost[0])\n writer.writeInt32(itemCost[1]);\n }\n\n // list of recipes.\n writer.writeInt32(header.recipeReferences.length);\n for (const recipeReference of header.recipeReferences) {\n ObjectReference.write(writer, recipeReference);\n }\n }\n}"]}
@@ -4,7 +4,7 @@ exports.BlueprintConfigReader = exports.BlueprintReader = void 0;
4
4
  const alignment_enum_1 = require("../../byte/alignment.enum");
5
5
  const context_reader_1 = require("../../context/context-reader");
6
6
  const parser_error_1 = require("../../error/parser.error");
7
- const level_class_1 = require("../save/level.class");
7
+ const level_1 = require("../save/level");
8
8
  const save_body_chunks_1 = require("../save/save-body-chunks");
9
9
  const SaveComponent_1 = require("../types/objects/SaveComponent");
10
10
  const SaveEntity_1 = require("../types/objects/SaveEntity");
@@ -35,7 +35,7 @@ class BlueprintReader extends context_reader_1.ContextReader {
35
35
  static ParseObjects(reader) {
36
36
  const objectHeadersBinarySize = reader.readInt32();
37
37
  let objects = [];
38
- level_class_1.Level.ReadAllObjectHeaders(reader, objects);
38
+ level_1.Level.ReadAllObjectHeaders(reader, objects);
39
39
  const someChecksumThing = reader.readInt32();
40
40
  BlueprintReader.ReadBlueprintObjectContents(reader, objects, 0);
41
41
  reader.getBufferPosition();
@@ -1 +1 @@
1
- {"version":3,"file":"blueprint-reader.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-reader.ts"],"names":[],"mappings":";;;AAAA,8DAAsD;AACtD,iEAA6D;AAC7D,2DAAmF;AACnF,qDAA4C;AAC5C,+DAAgF;AAChF,kEAAgF;AAChF,4DAAuE;AAIvE,MAAa,eAAgB,SAAQ,8BAAa;IAQjD,YAAY,eAAgC;QAC3C,KAAK,CAAC,eAAe,EAAE,0BAAS,CAAC,aAAa,CAAC,CAAC;QAP1C,oBAAe,GAAyB;YAC9C,cAAc,EAAE,CAAC;YACjB,+BAA+B,EAAE,CAAC;YAClC,kBAAkB,EAAE,iCAAc,CAAC,SAAS;SAC5C,CAAC;IAIF,CAAC;IAEM,aAAa;QAEnB,MAAM,MAAM,GAAG,iCAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACxG,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAG9C,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC;QACjD,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QAC1C,IAAI,CAAC,UAAU,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEhD,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAC3C,IAAI,MAAM,CAAC,gBAAgB,CAAC,UAAU,KAAK,iBAAiB,GAAG,CAAC,EAAE,CAAC;YAClE,MAAM,IAAI,oCAAqB,CAAC,6DAA6D,iBAAiB,GAAG,CAAC,kDAAkD,MAAM,CAAC,gBAAgB,CAAC,UAAU,GAAG,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EAAE,GAAG,CAAC,QAAQ,CAAC,CAAC;YACzD,CAAC;QACF,CAAC;IACF,CAAC;CAED;AArED,0CAqEC;AAED,MAAa,qBAAsB,SAAQ,8BAAa;IAEvD,YAAmB,qBAAsC;QACxD,KAAK,CAAC,qBAAqB,EAAE,0BAAS,CAAC,aAAa,CAAC,CAAC;QADpC,0BAAqB,GAArB,qBAAqB,CAAiB;IAEzD,CAAC;CACD;AALD,sDAKC","sourcesContent":["import { Alignment } from \"../../byte/alignment.enum\";\nimport { ContextReader } from '../../context/context-reader';\nimport { CorruptBlueprintError, CorruptSaveError } from \"../../error/parser.error\";\nimport { Level } from '../save/level.class';\nimport { ChunkCompressionInfo, SaveBodyChunks } from '../save/save-body-chunks';\nimport { SaveComponent, isSaveComponent } from \"../types/objects/SaveComponent\";\nimport { SaveEntity, isSaveEntity } from \"../types/objects/SaveEntity\";\nimport { SaveObject } from \"../types/objects/SaveObject\";\n\n\nexport class BlueprintReader extends ContextReader {\n\n\tpublic compressionInfo: ChunkCompressionInfo = {\n\t\tpackageFileTag: 0,\n\t\tmaxUncompressedChunkContentSize: 0,\n\t\tchunkHeaderVersion: SaveBodyChunks.HEADER_V2\n\t};\n\n\tconstructor(bluePrintBuffer: ArrayBufferLike) {\n\t\tsuper(bluePrintBuffer, Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic inflateChunks(): { inflatedData: ArrayBufferLike } {\n\n\t\tconst result = SaveBodyChunks.DecompressChunks(this.fileBuffer.slice(this.currentByte), this.alignment);\n\t\tthis.compressionInfo = result.compressionInfo;\n\n\t\t// reset on decompressed data.\n\t\tthis.currentByte = 0;\n\t\tthis.fileBuffer = result.uncompressedData.buffer;\n\t\tthis.maxByte = this.fileBuffer.byteLength;\n\t\tthis.bufferView = new DataView(this.fileBuffer);\n\n\t\tconst totalBodyRestSize = this.readInt32();\n\t\tif (result.uncompressedData.byteLength !== totalBodyRestSize + 4) {\n\t\t\tthrow new CorruptBlueprintError(`Possibly corrupt. Indicated size of total blueprint body (${totalBodyRestSize + 4}) does not match the uncompressed real size of ${result.uncompressedData.byteLength}.`);\n\t\t}\n\n\t\treturn {\n\t\t\tinflatedData: this.fileBuffer\n\t\t};\n\t}\n\n\tpublic static ParseObjects(reader: ContextReader): (SaveEntity | SaveComponent)[] {\n\n\t\t// object headers\n\t\tconst objectHeadersBinarySize = reader.readInt32();\n\t\tlet objects: (SaveEntity | SaveComponent)[] = [];\n\t\tLevel.ReadAllObjectHeaders(reader, objects);\n\n\t\tconst someChecksumThing = reader.readInt32();\n\n\t\t// objects contents\n\t\tBlueprintReader.ReadBlueprintObjectContents(reader, objects, 0);\n\n\t\treader.getBufferPosition();\n\n\t\treturn objects;\n\t}\n\n\tprivate static ReadBlueprintObjectContents(reader: ContextReader, objectsList: SaveObject[], buildVersion: number): void {\n\t\tconst countEntities = reader.readInt32();\n\t\tfor (let i = 0; i < countEntities; i++) {\n\n\t\t\t// binary length\n\t\t\tconst len = reader.readInt32();\n\t\t\tif (len === 0) {\n\t\t\t\tthrow new CorruptSaveError(`check number is a wrong value (${len}). This normally indicates a corrupt entity or blueprint.`);\n\t\t\t}\n\n\t\t\tconst obj = objectsList[i];\n\t\t\tif (isSaveEntity(obj)) {\n\t\t\t\tSaveEntity.ParseData(obj, len, reader, obj.typePath);\n\t\t\t} else if (isSaveComponent(obj)) {\n\t\t\t\tSaveComponent.ParseData(obj, len, reader, obj.typePath);\n\t\t\t}\n\t\t}\n\t}\n\n}\n\nexport class BlueprintConfigReader extends ContextReader {\n\n\tconstructor(public bluePrintConfigBuffer: ArrayBufferLike) {\n\t\tsuper(bluePrintConfigBuffer, Alignment.LITTLE_ENDIAN);\n\t}\n}\n"]}
1
+ {"version":3,"file":"blueprint-reader.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-reader.ts"],"names":[],"mappings":";;;AAAA,8DAAsD;AACtD,iEAA6D;AAC7D,2DAAmF;AACnF,yCAAsC;AACtC,+DAAgF;AAChF,kEAAgF;AA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AiB;IAEzD,CAAC;CACD;AALD,sDAKC","sourcesContent":["import { Alignment } from \"../../byte/alignment.enum\";\nimport { ContextReader } from '../../context/context-reader';\nimport { CorruptBlueprintError, CorruptSaveError } from \"../../error/parser.error\";\nimport { Level } from '../save/level';\nimport { ChunkCompressionInfo, SaveBodyChunks } from '../save/save-body-chunks';\nimport { SaveComponent, isSaveComponent } from \"../types/objects/SaveComponent\";\nimport { SaveEntity, isSaveEntity } from \"../types/objects/SaveEntity\";\nimport { SaveObject } from \"../types/objects/SaveObject\";\n\n\nexport class BlueprintReader extends ContextReader {\n\n\tpublic compressionInfo: ChunkCompressionInfo = {\n\t\tpackageFileTag: 0,\n\t\tmaxUncompressedChunkContentSize: 0,\n\t\tchunkHeaderVersion: SaveBodyChunks.HEADER_V2\n\t};\n\n\tconstructor(bluePrintBuffer: ArrayBufferLike) {\n\t\tsuper(bluePrintBuffer, Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic inflateChunks(): { inflatedData: ArrayBufferLike } {\n\n\t\tconst result = SaveBodyChunks.DecompressChunks(this.fileBuffer.slice(this.currentByte), this.alignment);\n\t\tthis.compressionInfo = result.compressionInfo;\n\n\t\t// reset on decompressed data.\n\t\tthis.currentByte = 0;\n\t\tthis.fileBuffer = result.uncompressedData.buffer;\n\t\tthis.maxByte = this.fileBuffer.byteLength;\n\t\tthis.bufferView = new DataView(this.fileBuffer);\n\n\t\tconst totalBodyRestSize = this.readInt32();\n\t\tif (result.uncompressedData.byteLength !== totalBodyRestSize + 4) {\n\t\t\tthrow new CorruptBlueprintError(`Possibly corrupt. Indicated size of total blueprint body (${totalBodyRestSize + 4}) does not match the uncompressed real size of ${result.uncompressedData.byteLength}.`);\n\t\t}\n\n\t\treturn {\n\t\t\tinflatedData: this.fileBuffer\n\t\t};\n\t}\n\n\tpublic static ParseObjects(reader: ContextReader): (SaveEntity | SaveComponent)[] {\n\n\t\t// object headers\n\t\tconst objectHeadersBinarySize = reader.readInt32();\n\t\tlet objects: (SaveEntity | SaveComponent)[] = [];\n\t\tLevel.ReadAllObjectHeaders(reader, objects);\n\n\t\tconst someChecksumThing = reader.readInt32();\n\n\t\t// objects contents\n\t\tBlueprintReader.ReadBlueprintObjectContents(reader, objects, 0);\n\n\t\treader.getBufferPosition();\n\n\t\treturn objects;\n\t}\n\n\tprivate static ReadBlueprintObjectContents(reader: ContextReader, objectsList: SaveObject[], buildVersion: number): void {\n\t\tconst countEntities = reader.readInt32();\n\t\tfor (let i = 0; i < countEntities; i++) {\n\n\t\t\t// binary length\n\t\t\tconst len = reader.readInt32();\n\t\t\tif (len === 0) {\n\t\t\t\tthrow new CorruptSaveError(`check number is a wrong value (${len}). This normally indicates a corrupt entity or blueprint.`);\n\t\t\t}\n\n\t\t\tconst obj = objectsList[i];\n\t\t\tif (isSaveEntity(obj)) {\n\t\t\t\tSaveEntity.ParseData(obj, len, reader, obj.typePath);\n\t\t\t} else if (isSaveComponent(obj)) {\n\t\t\t\tSaveComponent.ParseData(obj, len, reader, obj.typePath);\n\t\t\t}\n\t\t}\n\t}\n\n}\n\nexport class BlueprintConfigReader extends ContextReader {\n\n\tconstructor(public bluePrintConfigBuffer: ArrayBufferLike) {\n\t\tsuper(bluePrintConfigBuffer, Alignment.LITTLE_ENDIAN);\n\t}\n}\n"]}
@@ -4,7 +4,7 @@ exports.BlueprintConfigWriter = exports.BlueprintWriter = void 0;
4
4
  const alignment_enum_1 = require("../../byte/alignment.enum");
5
5
  const context_writer_1 = require("../../context/context-writer");
6
6
  const parser_error_1 = require("../../error/parser.error");
7
- const level_class_1 = require("../save/level.class");
7
+ const level_1 = require("../save/level");
8
8
  const save_writer_1 = require("../save/save-writer");
9
9
  const SaveComponent_1 = require("../types/objects/SaveComponent");
10
10
  const SaveEntity_1 = require("../types/objects/SaveEntity");
@@ -27,7 +27,7 @@ class BlueprintWriter extends context_writer_1.ContextWriter {
27
27
  static SerializeObjects(writer, objects) {
28
28
  const headersLenIndicator = writer.getBufferPosition();
29
29
  writer.writeInt32(0);
30
- level_class_1.Level.SerializeAllObjectHeaders(writer, objects);
30
+ level_1.Level.SerializeAllObjectHeaders(writer, objects);
31
31
  writer.writeBinarySizeFromPosition(headersLenIndicator, headersLenIndicator + 4);
32
32
  BlueprintWriter.SerializeObjectContents(writer, objects);
33
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"blueprint-writer.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-writer.ts"],"names":[],"mappings":";;;AAAA,8DAAsD;AACtD,iEAA6D;AAC7D,2DAAuD;AACvD,qDAA4C;AAE5C,qDAAiD;AACjD,kEAAgF;AAChF,4DAAuE;AAIvE,MAAa,eAAgB,SAAQ,8BAAa;IAEjD;QACC,KAAK,CAAC,0BAAS,CAAC,aAAa,CAAC,CAAC;IAChC,CAAC;IAEM,cAAc,CACpB,eAAqC,EACrC,cAAsB,EAEtB,OAIE;QAGF,IAAI,cAAc,IAAI,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,0BAAW,CAAC,aAAa,EAAE,qGAAqG,CAAC,CAAC;QAC7I,CAAC;QAGD,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC;QACzE,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC1B,CAAC;QAGD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QAC1D,MAAM,YAAY,GAAG,wBAAU,CAAC,gCAAgC,CAAC,IAAI,CAAC,WAAW,EAAE,eAAe,EAAE,OAAO,CAAC,yBAAyB,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS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,CAAC;IACpF,CAAC;CACD;AAjED,0CAiEC;AAED,MAAa,qBAAsB,SAAQ,8BAAa;IACvD;QACC,KAAK,CAAC,0BAAS,CAAC,aAAa,CAAC,CAAC;IAChC,CAAC;CACD;AAJD,sDAIC","sourcesContent":["import { Alignment } from \"../../byte/alignment.enum\";\nimport { ContextWriter } from '../../context/context-writer';\nimport { ParserError } from \"../../error/parser.error\";\nimport { Level } from '../save/level.class';\nimport { ChunkCompressionInfo, ChunkSummary } from \"../save/save-body-chunks\";\nimport { SaveWriter } from \"../save/save-writer\";\nimport { SaveComponent, isSaveComponent } from \"../types/objects/SaveComponent\";\nimport { SaveEntity, isSaveEntity } from \"../types/objects/SaveEntity\";\n\n\n\nexport class BlueprintWriter extends ContextWriter {\n\n\tconstructor() {\n\t\tsuper(Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic generateChunks(\n\t\tcompressionInfo: ChunkCompressionInfo,\n\t\tposAfterHeader: number,\n\n\t\toptions: Partial<{\n\t\t\tonBinaryBeforeCompressing: (binary: 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\tif (posAfterHeader <= 0) {\n\t\t\tthrow new ParserError('ParserError', 'seems like this buffer has no header. Please write the header first before you can generate chunks.');\n\t\t}\n\n\t\t// send plain header first.\n\t\tconst header = new Uint8Array(this.bufferArray.slice(0, posAfterHeader));\n\t\tif (options.onHeader !== undefined) {\n\t\t\toptions.onHeader(header);\n\t\t}\n\n\t\t// create save body\n\t\tthis.bufferArray = this.bufferArray.slice(posAfterHeader);\n\t\tconst chunkSummary = SaveWriter.GenerateCompressedChunksFromData(this.bufferArray, compressionInfo, options.onBinaryBeforeCompressing ?? (() => { }), options.onChunk ?? (() => { }), this.alignment);\n\t\treturn chunkSummary;\n\t}\n\n\tpublic static SerializeObjects(writer: ContextWriter, objects: (SaveEntity | SaveComponent)[]): void {\n\n\t\t// object headers\n\t\tconst headersLenIndicator = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\n\t\tLevel.SerializeAllObjectHeaders(writer, objects);\n\t\twriter.writeBinarySizeFromPosition(headersLenIndicator, headersLenIndicator + 4);\n\n\t\t// objects contents\n\t\tBlueprintWriter.SerializeObjectContents(writer, objects);\n\t}\n\n\tpublic static SerializeObjectContents(writer: ContextWriter, objects: (SaveEntity | SaveComponent)[]): void {\n\t\tconst lenIndicatorEntities = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\n\n\t\twriter.writeInt32(objects.length);\n\t\tfor (const obj of objects) {\n\n\t\t\tconst lenReplacementPosition = writer.getBufferPosition();\n\t\t\twriter.writeInt32(0);\n\n\t\t\tif (isSaveEntity(obj)) {\n\t\t\t\tSaveEntity.SerializeData(writer, obj);\n\t\t\t} else if (isSaveComponent(obj)) {\n\t\t\t\tSaveComponent.SerializeData(writer, obj);\n\t\t\t}\n\n\t\t\twriter.writeBinarySizeFromPosition(lenReplacementPosition, lenReplacementPosition + 4);\n\t\t}\n\t\twriter.writeBinarySizeFromPosition(lenIndicatorEntities, lenIndicatorEntities + 4);\n\t}\n}\n\nexport class BlueprintConfigWriter extends ContextWriter {\n\tconstructor() {\n\t\tsuper(Alignment.LITTLE_ENDIAN);\n\t}\n}"]}
1
+ {"version":3,"file":"blueprint-writer.js","sourceRoot":"","sources":["../../../../src/parser/satisfactory/blueprint/blueprint-writer.ts"],"names":[],"mappings":";;;AAAA,8DAAsD;AACtD,iEAA6D;AAC7D,2DAAuD;AACvD,yCAAsC;AAEtC,qDAAiD;AACjD,kEAAgF;AAChF,4DAAuE;AAIvE,MAAa,eAAgB,SAAQ,8BAAa;IAEjD;QACC,KAAK,CAAC,0BAAS,CAAC,aAAa,CAAC,CAAC;IAChC,CAAC;IAEM,cAAc,CACpB,eAAqC,EACrC,cAAsB,EAEtB,OAIE;QAGF,IAAI,cAAc,IAAI,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,0BAAW,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O,CAAC,MAAM,CAAC,CAAC;QAClC,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAE3B,MAAM,sBAAsB,GAAG,MAAM,CAAC,iBAAiB,EAAE,CAAC;YAC1D,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YAErB,IAAI,IAAA,yBAAY,EAAC,GAAG,CAAC,EAAE,CAAC;gBACvB,uBAAU,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACvC,CAAC;iBAAM,IAAI,IAAA,+BAAe,EAAC,GAAG,CAAC,EAAE,CAAC;gBACjC,6BAAa,CAAC,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC1C,CAAC;YAED,MAAM,CAAC,2BAA2B,CAAC,sBAAsB,EAAE,sBAAsB,GAAG,CAAC,CAAC,CAAC;QACxF,CAAC;QACD,MAAM,CAAC,2BAA2B,CAAC,oBAAoB,EAAE,oBAAoB,GAAG,CAAC,CAAC,CAAC;IACpF,CAAC;CACD;AAjED,0CAiEC;AAED,MAAa,qBAAsB,SAAQ,8BAAa;IACvD;QACC,KAAK,CAAC,0BAAS,CAAC,aAAa,CAAC,CAAC;IAChC,CAAC;CACD;AAJD,sDAIC","sourcesContent":["import { Alignment } from \"../../byte/alignment.enum\";\nimport { ContextWriter } from '../../context/context-writer';\nimport { ParserError } from \"../../error/parser.error\";\nimport { Level } from '../save/level';\nimport { ChunkCompressionInfo, ChunkSummary } from \"../save/save-body-chunks\";\nimport { SaveWriter } from \"../save/save-writer\";\nimport { SaveComponent, isSaveComponent } from \"../types/objects/SaveComponent\";\nimport { SaveEntity, isSaveEntity } from \"../types/objects/SaveEntity\";\n\n\n\nexport class BlueprintWriter extends ContextWriter {\n\n\tconstructor() {\n\t\tsuper(Alignment.LITTLE_ENDIAN);\n\t}\n\n\tpublic generateChunks(\n\t\tcompressionInfo: ChunkCompressionInfo,\n\t\tposAfterHeader: number,\n\n\t\toptions: Partial<{\n\t\t\tonBinaryBeforeCompressing: (binary: 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\tif (posAfterHeader <= 0) {\n\t\t\tthrow new ParserError('ParserError', 'seems like this buffer has no header. Please write the header first before you can generate chunks.');\n\t\t}\n\n\t\t// send plain header first.\n\t\tconst header = new Uint8Array(this.bufferArray.slice(0, posAfterHeader));\n\t\tif (options.onHeader !== undefined) {\n\t\t\toptions.onHeader(header);\n\t\t}\n\n\t\t// create save body\n\t\tthis.bufferArray = this.bufferArray.slice(posAfterHeader);\n\t\tconst chunkSummary = SaveWriter.GenerateCompressedChunksFromData(this.bufferArray, compressionInfo, options.onBinaryBeforeCompressing ?? (() => { }), options.onChunk ?? (() => { }), this.alignment);\n\t\treturn chunkSummary;\n\t}\n\n\tpublic static SerializeObjects(writer: ContextWriter, objects: (SaveEntity | SaveComponent)[]): void {\n\n\t\t// object headers\n\t\tconst headersLenIndicator = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\n\t\tLevel.SerializeAllObjectHeaders(writer, objects);\n\t\twriter.writeBinarySizeFromPosition(headersLenIndicator, headersLenIndicator + 4);\n\n\t\t// objects contents\n\t\tBlueprintWriter.SerializeObjectContents(writer, objects);\n\t}\n\n\tpublic static SerializeObjectContents(writer: ContextWriter, objects: (SaveEntity | SaveComponent)[]): void {\n\t\tconst lenIndicatorEntities = writer.getBufferPosition();\n\t\twriter.writeInt32(0);\n\n\t\twriter.writeInt32(objects.length);\n\t\tfor (const obj of objects) {\n\n\t\t\tconst lenReplacementPosition = writer.getBufferPosition();\n\t\t\twriter.writeInt32(0);\n\n\t\t\tif (isSaveEntity(obj)) {\n\t\t\t\tSaveEntity.SerializeData(writer, obj);\n\t\t\t} else if (isSaveComponent(obj)) {\n\t\t\t\tSaveComponent.SerializeData(writer, obj);\n\t\t\t}\n\n\t\t\twriter.writeBinarySizeFromPosition(lenReplacementPosition, lenReplacementPosition + 4);\n\t\t}\n\t\twriter.writeBinarySizeFromPosition(lenIndicatorEntities, lenIndicatorEntities + 4);\n\t}\n}\n\nexport class BlueprintConfigWriter extends ContextWriter {\n\tconstructor() {\n\t\tsuper(Alignment.LITTLE_ENDIAN);\n\t}\n}"]}