@etothepii/satisfactory-file-parser 1.1.1 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (512) hide show
  1. package/.github/workflows/tests.yml +24 -0
  2. package/CHANGELOG.md +88 -0
  3. package/README.md +6 -80
  4. package/build/index.d.ts +21 -3
  5. package/build/index.d.ts.map +1 -1
  6. package/build/index.js +21 -3
  7. package/build/index.js.map +1 -1
  8. package/build/parser/byte/byte-reader.class.d.ts +1 -1
  9. package/build/parser/byte/byte-reader.class.d.ts.map +1 -1
  10. package/build/parser/byte/byte-reader.class.js +4 -4
  11. package/build/parser/byte/byte-reader.class.js.map +1 -1
  12. package/build/parser/parser.d.ts +1 -1
  13. package/build/parser/parser.d.ts.map +1 -1
  14. package/build/parser/parser.js +1 -1
  15. package/build/parser/parser.js.map +1 -1
  16. package/build/parser/satisfactory/save/level.class.d.ts.map +1 -1
  17. package/build/parser/satisfactory/save/level.class.js +3 -1
  18. package/build/parser/satisfactory/save/level.class.js.map +1 -1
  19. package/build/parser/satisfactory/types/objects/SaveObject.d.ts +1 -1
  20. package/build/parser/satisfactory/types/objects/SaveObject.d.ts.map +1 -1
  21. package/build/parser/satisfactory/types/objects/SaveObject.js.map +1 -1
  22. package/build/parser/satisfactory/types/property/PropertiesList.d.ts +2 -2
  23. package/build/parser/satisfactory/types/property/PropertiesList.d.ts.map +1 -1
  24. package/build/parser/satisfactory/types/property/PropertiesList.js +6 -6
  25. package/build/parser/satisfactory/types/property/PropertiesList.js.map +1 -1
  26. package/build/parser/satisfactory/types/property/generic/AbstractBaseProperty.d.ts +21 -0
  27. package/build/parser/satisfactory/types/property/generic/AbstractBaseProperty.d.ts.map +1 -0
  28. package/build/parser/satisfactory/types/property/generic/AbstractBaseProperty.js +23 -0
  29. package/build/parser/satisfactory/types/property/generic/AbstractBaseProperty.js.map +1 -0
  30. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.d.ts +22 -0
  31. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.d.ts.map +1 -0
  32. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.js +128 -0
  33. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty.js.map +1 -0
  34. package/build/parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty.d.ts +14 -0
  35. package/build/parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty.d.ts.map +1 -0
  36. package/build/parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty.js +25 -0
  37. package/build/parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty.js.map +1 -0
  38. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty.d.ts +14 -0
  39. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty.d.ts.map +1 -0
  40. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty.js +25 -0
  41. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty.js.map +1 -0
  42. package/build/parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty.d.ts +14 -0
  43. package/build/parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty.d.ts.map +1 -0
  44. package/build/parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty.js +25 -0
  45. package/build/parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty.js.map +1 -0
  46. package/build/parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty.d.ts +14 -0
  47. package/build/parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty.d.ts.map +1 -0
  48. package/build/parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty.js +25 -0
  49. package/build/parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty.js.map +1 -0
  50. package/build/parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty.d.ts +14 -0
  51. package/build/parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty.d.ts.map +1 -0
  52. package/build/parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty.js +25 -0
  53. package/build/parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty.js.map +1 -0
  54. package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty.d.ts +14 -0
  55. package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty.d.ts.map +1 -0
  56. package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty.js +25 -0
  57. package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty.js.map +1 -0
  58. package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty.d.ts +14 -0
  59. package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty.d.ts.map +1 -0
  60. package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty.js +25 -0
  61. package/build/parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty.js.map +1 -0
  62. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty.d.ts +15 -0
  63. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty.d.ts.map +1 -0
  64. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty.js +25 -0
  65. package/build/parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty.js.map +1 -0
  66. package/build/parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty.d.ts +15 -0
  67. package/build/parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty.d.ts.map +1 -0
  68. package/build/parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty.js +25 -0
  69. package/build/parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty.js.map +1 -0
  70. package/build/parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty.d.ts +14 -0
  71. package/build/parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty.d.ts.map +1 -0
  72. package/build/parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty.js +25 -0
  73. package/build/parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty.js.map +1 -0
  74. package/build/parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty.d.ts +26 -0
  75. package/build/parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty.d.ts.map +1 -0
  76. package/build/parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty.js +72 -0
  77. package/build/parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty.js.map +1 -0
  78. package/build/parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty.d.ts +15 -0
  79. package/build/parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty.d.ts.map +1 -0
  80. package/build/parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty.js +25 -0
  81. package/build/parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty.js.map +1 -0
  82. package/build/parser/satisfactory/types/property/generic/BoolProperty.d.ts +3 -3
  83. package/build/parser/satisfactory/types/property/generic/BoolProperty.d.ts.map +1 -1
  84. package/build/parser/satisfactory/types/property/generic/BoolProperty.js +3 -3
  85. package/build/parser/satisfactory/types/property/generic/BoolProperty.js.map +1 -1
  86. package/build/parser/satisfactory/types/property/generic/ByteProperty.d.ts +3 -3
  87. package/build/parser/satisfactory/types/property/generic/ByteProperty.d.ts.map +1 -1
  88. package/build/parser/satisfactory/types/property/generic/ByteProperty.js +3 -3
  89. package/build/parser/satisfactory/types/property/generic/ByteProperty.js.map +1 -1
  90. package/build/parser/satisfactory/types/property/generic/DoubleProperty.d.ts +3 -3
  91. package/build/parser/satisfactory/types/property/generic/DoubleProperty.d.ts.map +1 -1
  92. package/build/parser/satisfactory/types/property/generic/DoubleProperty.js +3 -3
  93. package/build/parser/satisfactory/types/property/generic/DoubleProperty.js.map +1 -1
  94. package/build/parser/satisfactory/types/property/generic/EnumProperty.d.ts +3 -3
  95. package/build/parser/satisfactory/types/property/generic/EnumProperty.d.ts.map +1 -1
  96. package/build/parser/satisfactory/types/property/generic/EnumProperty.js +3 -3
  97. package/build/parser/satisfactory/types/property/generic/EnumProperty.js.map +1 -1
  98. package/build/parser/satisfactory/types/property/generic/FloatProperty.d.ts +3 -3
  99. package/build/parser/satisfactory/types/property/generic/FloatProperty.d.ts.map +1 -1
  100. package/build/parser/satisfactory/types/property/generic/FloatProperty.js +3 -3
  101. package/build/parser/satisfactory/types/property/generic/FloatProperty.js.map +1 -1
  102. package/build/parser/satisfactory/types/property/generic/Int32Property.d.ts +3 -3
  103. package/build/parser/satisfactory/types/property/generic/Int32Property.d.ts.map +1 -1
  104. package/build/parser/satisfactory/types/property/generic/Int32Property.js +3 -3
  105. package/build/parser/satisfactory/types/property/generic/Int32Property.js.map +1 -1
  106. package/build/parser/satisfactory/types/property/generic/Int64Property.d.ts +3 -3
  107. package/build/parser/satisfactory/types/property/generic/Int64Property.d.ts.map +1 -1
  108. package/build/parser/satisfactory/types/property/generic/Int64Property.js +3 -3
  109. package/build/parser/satisfactory/types/property/generic/Int64Property.js.map +1 -1
  110. package/build/parser/satisfactory/types/property/generic/Int8Property.d.ts +3 -3
  111. package/build/parser/satisfactory/types/property/generic/Int8Property.d.ts.map +1 -1
  112. package/build/parser/satisfactory/types/property/generic/Int8Property.js +3 -3
  113. package/build/parser/satisfactory/types/property/generic/Int8Property.js.map +1 -1
  114. package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts +3 -3
  115. package/build/parser/satisfactory/types/property/generic/MapProperty.d.ts.map +1 -1
  116. package/build/parser/satisfactory/types/property/generic/MapProperty.js +3 -3
  117. package/build/parser/satisfactory/types/property/generic/MapProperty.js.map +1 -1
  118. package/build/parser/satisfactory/types/property/generic/ObjectProperty.d.ts +3 -3
  119. package/build/parser/satisfactory/types/property/generic/ObjectProperty.d.ts.map +1 -1
  120. package/build/parser/satisfactory/types/property/generic/ObjectProperty.js +3 -3
  121. package/build/parser/satisfactory/types/property/generic/ObjectProperty.js.map +1 -1
  122. package/build/parser/satisfactory/types/property/generic/SetProperty/Int32SetProperty.d.ts +14 -0
  123. package/build/parser/satisfactory/types/property/generic/SetProperty/Int32SetProperty.d.ts.map +1 -0
  124. package/build/parser/satisfactory/types/property/generic/SetProperty/Int32SetProperty.js +25 -0
  125. package/build/parser/satisfactory/types/property/generic/SetProperty/Int32SetProperty.js.map +1 -0
  126. package/build/parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty.d.ts +15 -0
  127. package/build/parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty.d.ts.map +1 -0
  128. package/build/parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty.js +25 -0
  129. package/build/parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty.js.map +1 -0
  130. package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.d.ts +15 -0
  131. package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.d.ts.map +1 -0
  132. package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.js +73 -0
  133. package/build/parser/satisfactory/types/property/generic/SetProperty/SetProperty.js.map +1 -0
  134. package/build/parser/satisfactory/types/property/generic/SetProperty/StrSetProperty.d.ts +14 -0
  135. package/build/parser/satisfactory/types/property/generic/SetProperty/StrSetProperty.d.ts.map +1 -0
  136. package/build/parser/satisfactory/types/property/generic/SetProperty/StrSetProperty.js +25 -0
  137. package/build/parser/satisfactory/types/property/generic/SetProperty/StrSetProperty.js.map +1 -0
  138. package/build/parser/satisfactory/types/property/generic/SetProperty/StructSetProperty.d.ts +14 -0
  139. package/build/parser/satisfactory/types/property/generic/SetProperty/StructSetProperty.d.ts.map +1 -0
  140. package/build/parser/satisfactory/types/property/generic/SetProperty/StructSetProperty.js +45 -0
  141. package/build/parser/satisfactory/types/property/generic/SetProperty/StructSetProperty.js.map +1 -0
  142. package/build/parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty.d.ts +14 -0
  143. package/build/parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty.d.ts.map +1 -0
  144. package/build/parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty.js +25 -0
  145. package/build/parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty.js.map +1 -0
  146. package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.d.ts +3 -3
  147. package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.d.ts.map +1 -1
  148. package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.js +3 -3
  149. package/build/parser/satisfactory/types/property/generic/SoftObjectProperty.js.map +1 -1
  150. package/build/parser/satisfactory/types/property/generic/StrProperty.d.ts +3 -3
  151. package/build/parser/satisfactory/types/property/generic/StrProperty.d.ts.map +1 -1
  152. package/build/parser/satisfactory/types/property/generic/StrProperty.js +3 -3
  153. package/build/parser/satisfactory/types/property/generic/StrProperty.js.map +1 -1
  154. package/build/parser/satisfactory/types/property/generic/StructProperty.d.ts +4 -4
  155. package/build/parser/satisfactory/types/property/generic/StructProperty.d.ts.map +1 -1
  156. package/build/parser/satisfactory/types/property/generic/StructProperty.js +10 -10
  157. package/build/parser/satisfactory/types/property/generic/StructProperty.js.map +1 -1
  158. package/build/parser/satisfactory/types/property/generic/TextProperty.d.ts +3 -3
  159. package/build/parser/satisfactory/types/property/generic/TextProperty.d.ts.map +1 -1
  160. package/build/parser/satisfactory/types/property/generic/TextProperty.js +3 -3
  161. package/build/parser/satisfactory/types/property/generic/TextProperty.js.map +1 -1
  162. package/build/parser/satisfactory/types/property/generic/Uint32Property.d.ts +3 -3
  163. package/build/parser/satisfactory/types/property/generic/Uint32Property.d.ts.map +1 -1
  164. package/build/parser/satisfactory/types/property/generic/Uint32Property.js +3 -3
  165. package/build/parser/satisfactory/types/property/generic/Uint32Property.js.map +1 -1
  166. package/build/parser/satisfactory/types/property/generic/Uint64Property.d.ts +3 -3
  167. package/build/parser/satisfactory/types/property/generic/Uint64Property.d.ts.map +1 -1
  168. package/build/parser/satisfactory/types/property/generic/Uint64Property.js +3 -3
  169. package/build/parser/satisfactory/types/property/generic/Uint64Property.js.map +1 -1
  170. package/build/parser/satisfactory/types/property/generic/Uint8Property.d.ts +3 -3
  171. package/build/parser/satisfactory/types/property/generic/Uint8Property.d.ts.map +1 -1
  172. package/build/parser/satisfactory/types/property/generic/Uint8Property.js +3 -3
  173. package/build/parser/satisfactory/types/property/generic/Uint8Property.js.map +1 -1
  174. package/build/parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties.js +1 -1
  175. package/build/parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties.js.map +1 -1
  176. package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.d.ts +1 -1
  177. package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.d.ts.map +1 -1
  178. package/build/parser/satisfactory/types/property/special/SpecialDroneActionProperties.js.map +1 -1
  179. package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.d.ts +1 -1
  180. package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.d.ts.map +1 -1
  181. package/build/parser/satisfactory/types/structs/DynamicStructPropertyValue.js.map +1 -1
  182. package/build/parser/stream/reworked/readable-stream-parser.d.ts +1 -1
  183. package/build/parser/stream/reworked/readable-stream-parser.d.ts.map +1 -1
  184. package/build/parser/stream/reworked/readable-stream-parser.js +1 -1
  185. package/build/parser/stream/reworked/readable-stream-parser.js.map +1 -1
  186. package/docs/assets/navigation.js +1 -1
  187. package/docs/assets/search.js +1 -1
  188. package/docs/classes/AbstractBaseProperty.html +5 -4
  189. package/docs/classes/BlueprintConfigReader.html +5 -4
  190. package/docs/classes/BlueprintConfigWriter.html +3 -3
  191. package/docs/classes/BlueprintReader.html +5 -4
  192. package/docs/classes/BlueprintWriter.html +3 -3
  193. package/docs/classes/BoolProperty.html +3 -3
  194. package/docs/classes/ByteProperty.html +3 -3
  195. package/docs/classes/CompressionLibraryError.html +2 -2
  196. package/docs/classes/CorruptSaveError.html +2 -2
  197. package/docs/classes/DoubleProperty.html +3 -3
  198. package/docs/classes/EnumProperty.html +3 -3
  199. package/docs/classes/FloatProperty.html +3 -3
  200. package/docs/classes/Int32Property.html +3 -3
  201. package/docs/classes/Int64Property.html +3 -3
  202. package/docs/classes/Int8Property.html +3 -3
  203. package/docs/classes/MapProperty.html +3 -3
  204. package/docs/classes/ObjectProperty.html +3 -3
  205. package/docs/classes/Parser.html +7 -7
  206. package/docs/classes/ParserError.html +2 -2
  207. package/docs/classes/ReadableStreamParser.html +3 -3
  208. package/docs/classes/SatisfactorySave.html +2 -2
  209. package/docs/classes/SaveComponent.html +2 -2
  210. package/docs/classes/SaveEntity.html +2 -2
  211. package/docs/classes/SaveObject.html +14 -0
  212. package/docs/classes/SaveReader.html +5 -4
  213. package/docs/classes/SaveStreamJsonStringifier.html +2 -2
  214. package/docs/classes/SaveStreamWriter.html +2 -2
  215. package/docs/classes/SaveWriter.html +3 -3
  216. package/docs/classes/StrProperty.html +3 -3
  217. package/docs/classes/StructProperty.html +4 -4
  218. package/docs/classes/TextProperty.html +3 -3
  219. package/docs/classes/TimeoutError.html +2 -2
  220. package/docs/classes/Uint32Property.html +3 -3
  221. package/docs/classes/Uint64Property.html +3 -3
  222. package/docs/classes/Uint8Property.html +3 -3
  223. package/docs/classes/UnimplementedError.html +2 -2
  224. package/docs/classes/UnsupportedVersionError.html +2 -2
  225. package/docs/functions/ArrayProperty.CalcOverhead.html +1 -0
  226. package/docs/functions/ArrayProperty.Parse.html +1 -0
  227. package/docs/functions/ArrayProperty.Serialize.html +1 -0
  228. package/docs/functions/BoolArrayProperty.Parse.html +1 -0
  229. package/docs/functions/BoolArrayProperty.Serialize.html +1 -0
  230. package/docs/functions/BuildableSubsystemSpecialProperties.Parse.html +1 -1
  231. package/docs/functions/BuildableSubsystemSpecialProperties.Serialize.html +1 -1
  232. package/docs/functions/ByteArrayProperty.Parse.html +1 -0
  233. package/docs/functions/ByteArrayProperty.Serialize.html +1 -0
  234. package/docs/functions/CircuitSpecialProperties.Parse.html +1 -1
  235. package/docs/functions/CircuitSpecialProperties.Serialize.html +1 -1
  236. package/docs/functions/ConveyorChainActorSpecialProperties.Parse.html +1 -1
  237. package/docs/functions/ConveyorChainActorSpecialProperties.Serialize.html +1 -1
  238. package/docs/functions/ConveyorSpecialProperties.Parse.html +1 -1
  239. package/docs/functions/ConveyorSpecialProperties.Serialize.html +1 -1
  240. package/docs/functions/DoubleArrayProperty.Parse.html +1 -0
  241. package/docs/functions/DoubleArrayProperty.Serialize.html +1 -0
  242. package/docs/functions/DynamicStructPropertyValue.read.html +1 -1
  243. package/docs/functions/DynamicStructPropertyValue.write.html +1 -1
  244. package/docs/functions/EmptySpecialProperties.Parse.html +1 -1
  245. package/docs/functions/EmptySpecialProperties.Serialize.html +1 -1
  246. package/docs/functions/EnumArrayProperty.Parse.html +1 -0
  247. package/docs/functions/EnumArrayProperty.Serialize.html +1 -0
  248. package/docs/functions/FICFrameRange.Parse.html +1 -1
  249. package/docs/functions/FICFrameRange.Serialize.html +1 -1
  250. package/docs/functions/FloatArrayProperty.Parse.html +1 -0
  251. package/docs/functions/FloatArrayProperty.Serialize.html +1 -0
  252. package/docs/functions/GUID.read.html +1 -1
  253. package/docs/functions/GUID.write.html +1 -1
  254. package/docs/functions/GUIDInfo.read.html +1 -1
  255. package/docs/functions/GUIDInfo.write.html +1 -1
  256. package/docs/functions/Int32ArrayProperty.Parse.html +1 -0
  257. package/docs/functions/Int32ArrayProperty.Serialize.html +1 -0
  258. package/docs/functions/Int32SetProperty.Parse.html +1 -0
  259. package/docs/functions/Int32SetProperty.Serialize.html +1 -0
  260. package/docs/functions/Int64ArrayProperty.Parse.html +1 -0
  261. package/docs/functions/Int64ArrayProperty.Serialize.html +1 -0
  262. package/docs/functions/Level.ReadAllObjectContents.html +1 -1
  263. package/docs/functions/Level.ReadAllObjectHeaders.html +1 -1
  264. package/docs/functions/Level.ReadLevel.html +1 -1
  265. package/docs/functions/Level.ReadNObjectContents.html +1 -1
  266. package/docs/functions/Level.ReadNObjectHeaders.html +1 -1
  267. package/docs/functions/Level.SerializeAllObjectContents.html +1 -1
  268. package/docs/functions/Level.SerializeAllObjectHeaders.html +1 -1
  269. package/docs/functions/Level.SerializeLevel.html +1 -1
  270. package/docs/functions/MD5Hash.read.html +1 -1
  271. package/docs/functions/MD5Hash.write.html +1 -1
  272. package/docs/functions/ObjectArrayProperty.Parse.html +1 -0
  273. package/docs/functions/ObjectArrayProperty.Serialize.html +1 -0
  274. package/docs/functions/ObjectReference.read.html +1 -1
  275. package/docs/functions/ObjectReference.write.html +1 -1
  276. package/docs/functions/ObjectSetProperty.Parse.html +1 -0
  277. package/docs/functions/ObjectSetProperty.Serialize.html +1 -0
  278. package/docs/functions/ObjectsListSpecialProperties.Parse.html +1 -1
  279. package/docs/functions/ObjectsListSpecialProperties.Serialize.html +1 -1
  280. package/docs/functions/PlayerSpecialProperties.Parse.html +1 -1
  281. package/docs/functions/PlayerSpecialProperties.Serialize.html +1 -1
  282. package/docs/functions/PowerLineSpecialProperties.Parse.html +1 -1
  283. package/docs/functions/PowerLineSpecialProperties.Serialize.html +1 -1
  284. package/docs/functions/PropertiesList.ParseList.html +1 -1
  285. package/docs/functions/PropertiesList.ParseSingleProperty.html +1 -1
  286. package/docs/functions/PropertiesList.SerializeList.html +1 -1
  287. package/docs/functions/PropertiesList.SerializeSingleProperty.html +1 -1
  288. package/docs/functions/SetProperty.CalcOverhead.html +1 -0
  289. package/docs/functions/SetProperty.Parse.html +1 -0
  290. package/docs/functions/SetProperty.Serialize.html +1 -0
  291. package/docs/functions/SoftObjectArrayProperty.Parse.html +1 -0
  292. package/docs/functions/SoftObjectArrayProperty.Serialize.html +1 -0
  293. package/docs/functions/SoftObjectReference.read.html +1 -1
  294. package/docs/functions/SoftObjectReference.write.html +1 -1
  295. package/docs/functions/SpecialDroneActionProperties.Parse.html +1 -1
  296. package/docs/functions/SpecialDroneActionProperties.Serialize.html +1 -1
  297. package/docs/functions/SpecialProperties.ParseClassSpecificSpecialProperties.html +1 -1
  298. package/docs/functions/SpecialProperties.SerializeClassSpecificSpecialProperties.html +1 -1
  299. package/docs/functions/StrArrayProperty.Parse.html +1 -0
  300. package/docs/functions/StrArrayProperty.Serialize.html +1 -0
  301. package/docs/functions/StrSetProperty.Parse.html +1 -0
  302. package/docs/functions/StrSetProperty.Serialize.html +1 -0
  303. package/docs/functions/StructArrayProperty.Parse.html +1 -0
  304. package/docs/functions/StructArrayProperty.Serialize.html +1 -0
  305. package/docs/functions/StructSetProperty.Parse.html +1 -0
  306. package/docs/functions/StructSetProperty.Serialize.html +1 -0
  307. package/docs/functions/TextArrayProperty.Parse.html +1 -0
  308. package/docs/functions/TextArrayProperty.Serialize.html +1 -0
  309. package/docs/functions/Transform.Parse.html +1 -1
  310. package/docs/functions/Transform.ParseF.html +1 -1
  311. package/docs/functions/Transform.Serialize.html +1 -1
  312. package/docs/functions/Transform.SerializeF.html +1 -1
  313. package/docs/functions/Uint32SetProperty.Parse.html +1 -0
  314. package/docs/functions/Uint32SetProperty.Serialize.html +1 -0
  315. package/docs/functions/VehicleSpecialProperties.Parse.html +1 -1
  316. package/docs/functions/VehicleSpecialProperties.Serialize.html +1 -1
  317. package/docs/functions/col4.ParseBGRA.html +1 -1
  318. package/docs/functions/col4.ParseRGBA.html +1 -1
  319. package/docs/functions/col4.SerializeBGRA.html +1 -1
  320. package/docs/functions/col4.SerializeRGBA.html +1 -1
  321. package/docs/functions/isArrayProperty.html +1 -1
  322. package/docs/functions/isBoolArrayProperty.html +1 -0
  323. package/docs/functions/isBoolProperty.html +1 -1
  324. package/docs/functions/isBuildableSubsystemSpecialProperties.html +1 -1
  325. package/docs/functions/isByteArrayProperty.html +1 -0
  326. package/docs/functions/isByteProperty.html +1 -1
  327. package/docs/functions/isCircuitSpecialProperties.html +1 -1
  328. package/docs/functions/isConveyorChainActorSpecialProperties.html +1 -1
  329. package/docs/functions/isConveyorSpecialProperties.html +1 -1
  330. package/docs/functions/isDoubleArrayProperty.html +1 -0
  331. package/docs/functions/isDoubleProperty.html +1 -1
  332. package/docs/functions/isEmptySpecialProperties.html +1 -1
  333. package/docs/functions/isEnumArrayProperty.html +1 -0
  334. package/docs/functions/isEnumProperty.html +1 -1
  335. package/docs/functions/isFloatArrayProperty.html +1 -0
  336. package/docs/functions/isFloatProperty.html +1 -1
  337. package/docs/functions/isInt32ArrayProperty.html +1 -0
  338. package/docs/functions/isInt32Property.html +1 -1
  339. package/docs/functions/isInt32SetProperty.html +1 -0
  340. package/docs/functions/isInt64ArrayProperty.html +1 -0
  341. package/docs/functions/isInt64Property.html +1 -1
  342. package/docs/functions/isInt8Property.html +1 -1
  343. package/docs/functions/isMapProperty.html +1 -1
  344. package/docs/functions/isObjectArrayProperty.html +1 -0
  345. package/docs/functions/isObjectProperty.html +1 -1
  346. package/docs/functions/isObjectSetProperty.html +1 -0
  347. package/docs/functions/isObjectsListSpecialProperties.html +1 -1
  348. package/docs/functions/isPlayerSpecialProperties.html +1 -1
  349. package/docs/functions/isPowerLineSpecialProperties.html +1 -1
  350. package/docs/functions/isSaveComponent.html +1 -1
  351. package/docs/functions/isSaveEntity.html +1 -1
  352. package/docs/functions/isSetProperty.html +1 -1
  353. package/docs/functions/isSoftObjectArrayProperty.html +1 -0
  354. package/docs/functions/isSpecialDroneActionProperties.html +1 -1
  355. package/docs/functions/isStrArrayProperty.html +1 -0
  356. package/docs/functions/isStrProperty.html +1 -1
  357. package/docs/functions/isStrSetProperty.html +1 -0
  358. package/docs/functions/isStructArrayProperty.html +1 -0
  359. package/docs/functions/isStructProperty.html +1 -1
  360. package/docs/functions/isStructSetProperty.html +1 -0
  361. package/docs/functions/isTextArrayProperty.html +1 -0
  362. package/docs/functions/isTextProperty.html +1 -1
  363. package/docs/functions/isUInt64Property.html +1 -1
  364. package/docs/functions/isUint32Property.html +1 -1
  365. package/docs/functions/isUint32SetProperty.html +1 -0
  366. package/docs/functions/isUint8Property.html +1 -1
  367. package/docs/functions/isVehicleSpecialProperties.html +1 -1
  368. package/docs/functions/vec2.Parse.html +1 -1
  369. package/docs/functions/vec2.ParseF.html +1 -1
  370. package/docs/functions/vec2.Serialize.html +1 -1
  371. package/docs/functions/vec2.SerializeF.html +1 -1
  372. package/docs/functions/vec3.Parse.html +1 -1
  373. package/docs/functions/vec3.ParseF.html +1 -1
  374. package/docs/functions/vec3.ParseInt.html +1 -1
  375. package/docs/functions/vec3.Serialize.html +1 -1
  376. package/docs/functions/vec3.SerializeF.html +1 -1
  377. package/docs/functions/vec3.SerializeInt.html +1 -1
  378. package/docs/functions/vec3.add.html +1 -1
  379. package/docs/functions/vec3.length.html +1 -1
  380. package/docs/functions/vec3.mult.html +1 -1
  381. package/docs/functions/vec3.norm.html +1 -1
  382. package/docs/functions/vec3.sub.html +1 -1
  383. package/docs/functions/vec4.Parse.html +1 -1
  384. package/docs/functions/vec4.ParseF.html +1 -1
  385. package/docs/functions/vec4.Serialize.html +1 -1
  386. package/docs/functions/vec4.SerializeF.html +1 -1
  387. package/docs/hierarchy.html +1 -1
  388. package/docs/index.html +5 -61
  389. package/docs/interfaces/Blueprint.html +2 -2
  390. package/docs/interfaces/BlueprintConfig.html +2 -2
  391. package/docs/interfaces/ModData.html +2 -2
  392. package/docs/interfaces/SatisfactoryModMetadata.html +2 -2
  393. package/docs/interfaces/SatisfactorySaveHeader.html +2 -2
  394. package/docs/interfaces/SaveComponentHeader.html +2 -2
  395. package/docs/interfaces/SaveEntityHeader.html +2 -2
  396. package/docs/interfaces/SaveObjectHeader.html +4 -0
  397. package/docs/modules/ArrayProperty.html +5 -0
  398. package/docs/modules/BoolArrayProperty.html +3 -0
  399. package/docs/modules/BuildableSubsystemSpecialProperties.html +1 -1
  400. package/docs/modules/ByteArrayProperty.html +3 -0
  401. package/docs/modules/CircuitSpecialProperties.html +1 -1
  402. package/docs/modules/ConveyorChainActorSpecialProperties.html +1 -1
  403. package/docs/modules/ConveyorSpecialProperties.html +1 -1
  404. package/docs/modules/DoubleArrayProperty.html +3 -0
  405. package/docs/modules/DynamicStructPropertyValue.html +1 -1
  406. package/docs/modules/EmptySpecialProperties.html +1 -1
  407. package/docs/modules/EnumArrayProperty.html +3 -0
  408. package/docs/modules/FICFrameRange.html +1 -1
  409. package/docs/modules/FloatArrayProperty.html +3 -0
  410. package/docs/modules/GUID.html +1 -1
  411. package/docs/modules/GUIDInfo.html +1 -1
  412. package/docs/modules/Int32ArrayProperty.html +3 -0
  413. package/docs/modules/Int32SetProperty.html +3 -0
  414. package/docs/modules/Int64ArrayProperty.html +3 -0
  415. package/docs/modules/Level.html +1 -1
  416. package/docs/modules/MD5Hash.html +1 -1
  417. package/docs/modules/ObjectArrayProperty.html +3 -0
  418. package/docs/modules/ObjectReference.html +1 -1
  419. package/docs/modules/ObjectSetProperty.html +3 -0
  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/SetProperty.html +5 -0
  425. package/docs/modules/SoftObjectArrayProperty.html +3 -0
  426. package/docs/modules/SoftObjectReference.html +1 -1
  427. package/docs/modules/SpecialDroneActionProperties.html +1 -1
  428. package/docs/modules/SpecialProperties.html +1 -1
  429. package/docs/modules/StrArrayProperty.html +3 -0
  430. package/docs/modules/StrSetProperty.html +3 -0
  431. package/docs/modules/StructArrayProperty.html +3 -0
  432. package/docs/modules/StructSetProperty.html +3 -0
  433. package/docs/modules/TextArrayProperty.html +3 -0
  434. package/docs/modules/Transform.html +1 -1
  435. package/docs/modules/Uint32SetProperty.html +3 -0
  436. package/docs/modules/VehicleSpecialProperties.html +1 -1
  437. package/docs/modules/col4.html +1 -1
  438. package/docs/modules/vec2.html +1 -1
  439. package/docs/modules/vec3.html +1 -1
  440. package/docs/modules/vec4.html +1 -1
  441. package/docs/modules.html +56 -5
  442. package/docs/types/ArrayProperty.AvailableArrayPropertyTypes.html +1 -0
  443. package/docs/types/ArrayPropertyStructValueFields.html +1 -1
  444. package/docs/types/BasicMultipleStructPropertyValue.html +1 -1
  445. package/docs/types/BasicStructPropertyValue.html +1 -1
  446. package/docs/types/BlueprintHeader.html +1 -1
  447. package/docs/types/BoolArrayProperty-1.html +1 -0
  448. package/docs/types/BoxStructPropertyValue.html +1 -1
  449. package/docs/types/BuildableSubsystemSpecialProperties-1.html +1 -1
  450. package/docs/types/BuildableTypeInstance.html +1 -1
  451. package/docs/types/ByteArrayProperty-1.html +1 -0
  452. package/docs/types/BytePropertyValue.html +1 -1
  453. package/docs/types/CircuitSpecialProperties-1.html +1 -1
  454. package/docs/types/ClientIdentityInfo.html +1 -1
  455. package/docs/types/ConveyorChainActorSpecialProperties-1.html +1 -1
  456. package/docs/types/ConveyorChainSegmentSpecialProperties.html +1 -1
  457. package/docs/types/ConveyorItemSpecialProperties.html +1 -1
  458. package/docs/types/ConveyorSpecialProperties-1.html +1 -1
  459. package/docs/types/DoubleArrayProperty-1.html +1 -0
  460. package/docs/types/DynamicStructPropertyValue-1.html +1 -1
  461. package/docs/types/EmptySpecialProperties-1.html +1 -1
  462. package/docs/types/EnumArrayProperty-1.html +1 -0
  463. package/docs/types/FICFrameRange-1.html +1 -1
  464. package/docs/types/FICFrameRangeStructPropertyValue.html +1 -1
  465. package/docs/types/FloatArrayProperty-1.html +1 -0
  466. package/docs/types/GENERIC_MAP_KEY_TYPE.html +1 -1
  467. package/docs/types/GENERIC_MAP_VALUE_TYPE.html +1 -1
  468. package/docs/types/GENERIC_STRUCT_PROPERTY_VALUE.html +1 -1
  469. package/docs/types/GUID-1.html +1 -1
  470. package/docs/types/GUIDInfo-1.html +1 -1
  471. package/docs/types/Int32ArrayProperty-1.html +1 -0
  472. package/docs/types/Int32SetProperty-1.html +1 -0
  473. package/docs/types/Int64ArrayProperty-1.html +1 -0
  474. package/docs/types/InventoryItemStructPropertyValue.html +1 -1
  475. package/docs/types/Level-1.html +1 -1
  476. package/docs/types/MAP_STRUCT_KEY_PROXY.html +1 -1
  477. package/docs/types/MD5Hash-1.html +1 -1
  478. package/docs/types/ObjectArrayProperty-1.html +1 -0
  479. package/docs/types/ObjectReference-1.html +1 -1
  480. package/docs/types/ObjectSetProperty-1.html +1 -0
  481. package/docs/types/ObjectsListSpecialProperties-1.html +1 -1
  482. package/docs/types/PlayerSpecialProperties-1.html +1 -1
  483. package/docs/types/PowerLineSpecialProperties-1.html +1 -1
  484. package/docs/types/PropertiesMap.html +1 -1
  485. package/docs/types/RailroadTrackPositionStructPropertyValue.html +1 -1
  486. package/docs/types/RoughSaveVersion.html +1 -1
  487. package/docs/types/SetProperty.AvailableSetPropertyTypes.html +1 -0
  488. package/docs/types/SoftObjectArrayProperty-1.html +1 -0
  489. package/docs/types/SoftObjectReference-1.html +1 -1
  490. package/docs/types/SpecialDroneAction.html +1 -1
  491. package/docs/types/SpecialDroneActionProperties-1.html +1 -1
  492. package/docs/types/SpecialProperties.AvailableSpecialPropertiesTypes.html +1 -1
  493. package/docs/types/StrArrayProperty-1.html +1 -0
  494. package/docs/types/StrSetProperty-1.html +1 -0
  495. package/docs/types/StructArrayProperty-1.html +1 -0
  496. package/docs/types/StructSetProperty-1.html +1 -0
  497. package/docs/types/TextArrayProperty-1.html +1 -0
  498. package/docs/types/TextPropertyValue.html +1 -1
  499. package/docs/types/Transform-1.html +1 -1
  500. package/docs/types/Uint32SetProperty-1.html +1 -0
  501. package/docs/types/VehicleSpecialProperties-1.html +1 -1
  502. package/docs/types/col4-1.html +1 -1
  503. package/docs/types/vec2-1.html +1 -1
  504. package/docs/types/vec3-1.html +1 -1
  505. package/docs/types/vec4-1.html +1 -1
  506. package/docs/variables/EDIT.html +1 -1
  507. package/package.json +2 -2
  508. package/LICENSE +0 -21
  509. package/docs/classes/AbstractProperty.html +0 -4
  510. package/docs/classes/ArrayProperty.html +0 -13
  511. package/docs/classes/BasicProperty.html +0 -7
  512. package/docs/classes/SetProperty.html +0 -12
@@ -0,0 +1,24 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ branches: [ main ]
7
+
8
+ jobs:
9
+ build:
10
+
11
+ runs-on: ubuntu-latest
12
+
13
+ strategy:
14
+ matrix:
15
+ node-version: [20.x, 22.x]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+ - name: Use Node.js ${{ matrix.node-version }}
20
+ uses: actions/setup-node@v4
21
+ with:
22
+ node-version: ${{ matrix.node-version }}
23
+ - run: npm ci
24
+ - run: npm test
package/CHANGELOG.md ADDED
@@ -0,0 +1,88 @@
1
+
2
+ # Changelog
3
+ ### [2.0.1] (2024-10-31)
4
+ #### Normal Properties Update
5
+ * Most Normal Properties classes got refactored to namespaces as well. More will come. Please refrain from using instances of them. Background being, that its anyway only static methods and types.
6
+ * Since normal properties of an object are effectively always of type `AbstractBaseProperty | AbstractBaseProperty[]`, the `AbstractBaseProperty` has now all fields and `BasicProperty` got removed as there is no difference anymore between the two. They would be the same now.
7
+ * type guards of "normal" properties like `isObjectProperty()` accept now `any` as parameter and should work now as expected
8
+ * Since ArrayProperties and SetProperties in the save format dont necessarily always have the same structure as their subtype, I introduced own types like `StrArrayProperty` and `Int32SetProperty` with corresponding type guards (e.g. `isStrArrayProperty()`). Means more overhead in code, but hence its more correct in usage.
9
+ #### Bugfix
10
+ * The total conveyor length in the special properties of a ConveyorChainActor got serialized as int32, but correctly now serialize as float32.
11
+
12
+
13
+ ### [1.1.1] (2024-10-21)
14
+ #### Improved Special Properties
15
+ * Improved on SpecialProperties of BuildableSubsystem and ConveyorChainActor as the meaning became more clear.
16
+ * Special Properties are refactored into their own namespaces and exported.
17
+ * The union type `SpecialAnyProperties` is now automatically derived and more concisely named `SpecialProperties.AvailableSpecialPropertiesTypes` instead, in case you need it.
18
+
19
+ ### [1.0.3] (2024-10-17)
20
+ #### Hotfix
21
+ * fix being forced to use callbacks when writing saves or blueprints.
22
+
23
+ ### [1.0.2] (2024-10-17)
24
+ #### Internal renaming
25
+ * `...SpecialProperty` got all renamed to `...SpecialProperties`.
26
+
27
+ ### [1.0.1] (2024-10-17)
28
+ #### Major breaking changes on Parser usage
29
+ * Cleaned Usage methods of Save / Blueprint Parsing. The callbacks are an optional additional parameter object now instead of required.
30
+ * Re-Added a method to parse Saves in memory again. (sorry for the inconvenience)
31
+ #### Internal structure changes
32
+ * `SatisfactorySave` structure changed, the `grids` and `gridHash` fields are slightly different now, since their meaning became more clear. Not relevant for normal save editing.
33
+ * `Level` is a namespace instead of a class now, since the classes had only static methods anyway.
34
+ #### module build now includes source maps
35
+ #### module build should now include a docs folder for auto-generated documentation
36
+
37
+ ### [0.5.1] (2024-10-15)
38
+ #### Added Mod Support
39
+ #### Internal Renamings
40
+ * `DynamicStructPropertyValue` extracted to own file.
41
+ * Parsing of object data partially moved to `SaveObject`.
42
+ * Renamed `DataFields` class to `PropertiesList`.
43
+ * Moved parsing of class-specific properties into own namespace.
44
+ * `ObjectProperty` and `SoftObjectProperty` now reuse the correct method for parsing/serializing the reference value.
45
+
46
+ ### [0.4.22] (2024-10-07)
47
+ #### compatibility fix
48
+ * referenced icon libraries in blueprints are now optional when being parsed.
49
+
50
+ ### [0.4.21] (2024-10-07)
51
+ #### internal package restructuring
52
+ * restructured some internal packages.
53
+ * provides now typeguards for every property.
54
+
55
+ ### [0.4.20] (2024-10-06)
56
+ #### bugfix
57
+ * added parsing of icon library reference to parsing blueprints.
58
+
59
+ ### [0.4.19] (2024-10-06)
60
+ #### Migrated repo to public github
61
+
62
+ ### [0.4.18] (2024-10-05)
63
+ #### updated README
64
+
65
+ ### [0.4.17] (2024-10-05)
66
+ #### updated README
67
+ #### bugfix
68
+ * `ClientIdentityInfo` field names and structure got changed, since the meaning is now more clear.
69
+ * removed trailing object list from satisfactory save object.
70
+ * deleted entities references get serialized again, just based on collectables list.
71
+
72
+ ### [0.4.16] (2024-10-03)
73
+ #### bugfix
74
+ * exporting `isSaveEntity` and `isSaveComponent` again.
75
+
76
+ ### [0.4.15] (2024-10-02)
77
+ #### updated README
78
+ * changelog document doesn't seem linkable, so it is in the readme for now.
79
+
80
+ ### [0.4.14] (2024-10-02)
81
+ #### updated README
82
+ * updated the code examples with more context
83
+ #### Internal renamings (won't affect you if you stick to the code examples)
84
+ * improved the interface for abstract parser classes
85
+ * extended some error log messages
86
+ * added an additional check when parsing struct property InventoryItem, since ported saves often have a few more bytes.
87
+ * changed function name `writeFloat()` to `writeFloat32()` of the save writer.
88
+ * changed variable name `saveOrBlueprintIndicator` to `objectVersion` for objects, since the meaning of that number became now more clear.
package/README.md CHANGED
@@ -18,8 +18,11 @@ Game Version Files of U5 and below are NOT supported.
18
18
  | U8 | ✅ 0.1.20 - 0.3.7 |
19
19
  | U1.0 | ✅ >= 0.4.20 |
20
20
 
21
- # Installation via npm
21
+ # Installation
22
+ #### npm
22
23
  `npm install @etothepii/satisfactory-file-parser`
24
+ #### yarn
25
+ `yarn add @etothepii/satisfactory-file-parser`
23
26
 
24
27
  # Mod Support ✅
25
28
  By Default, most Mods just reuse Properties and Structs of the base game.
@@ -161,86 +164,9 @@ const blueprint = Parser.ParseBlueprintFiles('Myblueprint', file, configFile, {
161
164
  ```
162
165
 
163
166
  # Bug Reports or Feedback
164
- You can always raise an issue on the linked github project or hit me up on the satisfactory discord `etothepii`.
165
-
166
- # Changelog
167
- ### [1.1.1] (2024-10-21)
168
- #### Improved Special Properties
169
- * Improved on SpecialProperties of BuildableSubsystem and ConveyorChainActor as the meaning became more clear.
170
- * Special Properties are refactored into their own namespaces and exported.
171
- * The union type `SpecialAnyProperties` is now automatically derived and more concisely named `SpecialProperties.AvailableSpecialPropertiesTypes` instead, in case you need it.
172
-
173
- ### [1.0.3] (2024-10-17)
174
- #### Hotfix
175
- * fix being forced to use callbacks when writing saves or blueprints.
176
-
177
- ### [1.0.2] (2024-10-17)
178
- #### Internal renaming
179
- * `...SpecialProperty` got all renamed to `...SpecialProperties`.
180
-
181
- ### [1.0.1] (2024-10-17)
182
- #### Major breaking changes on Parser usage
183
- * Cleaned Usage methods of Save / Blueprint Parsing. The callbacks are an optional additional parameter object now instead of required.
184
- * Re-Added a method to parse Saves in memory again. (sorry for the inconvenience)
185
- #### Internal structure changes
186
- * `SatisfactorySave` structure changed, the `grids` and `gridHash` fields are slightly different now, since their meaning became more clear. Not relevant for normal save editing.
187
- * `Level` is a namespace instead of a class now, since the classes had only static methods anyway.
188
- #### module build now includes source maps
189
- #### module build should now include a docs folder for auto-generated documentation
190
-
191
- ### [0.5.1] (2024-10-15)
192
- #### Added Mod Support
193
- #### Internal Renamings
194
- * `DynamicStructPropertyValue` extracted to own file.
195
- * Parsing of object data partially moved to `SaveObject`.
196
- * Renamed `DataFields` class to `PropertiesList`.
197
- * Moved parsing of class-specific properties into own namespace.
198
- * `ObjectProperty` and `SoftObjectProperty` now reuse the correct method for parsing/serializing the reference value.
199
-
200
- ### [0.4.22] (2024-10-07)
201
- #### compatibility fix
202
- * referenced icon libraries in blueprints are now optional when being parsed.
203
-
204
- ### [0.4.21] (2024-10-07)
205
- #### internal package restructuring
206
- * restructured some internal packages.
207
- * provides now typeguards for every property.
208
-
209
- ### [0.4.20] (2024-10-06)
210
- #### bugfix
211
- * added parsing of icon library reference to parsing blueprints.
212
-
213
- ### [0.4.19] (2024-10-06)
214
- #### Migrated repo to public github
215
-
216
- ### [0.4.18] (2024-10-05)
217
- #### updated README
218
-
219
- ### [0.4.17] (2024-10-05)
220
- #### updated README
221
- #### bugfix
222
- * `ClientIdentityInfo` field names and structure got changed, since the meaning is now more clear.
223
- * removed trailing object list from satisfactory save object.
224
- * deleted entities references get serialized again, just based on collectables list.
225
-
226
- ### [0.4.16] (2024-10-03)
227
- #### bugfix
228
- * exporting `isSaveEntity` and `isSaveComponent` again.
229
-
230
- ### [0.4.15] (2024-10-02)
231
- #### updated README
232
- * changelog document doesn't seem linkable, so it is in the readme for now.
233
-
234
- ### [0.4.14] (2024-10-02)
235
- #### updated README
236
- * updated the code examples with more context
237
- #### Internal renamings (won't affect you if you stick to the code examples)
238
- * improved the interface for abstract parser classes
239
- * extended some error log messages
240
- * added an additional check when parsing struct property InventoryItem, since ported saves often have a few more bytes.
241
- * changed function name `writeFloat()` to `writeFloat32()` of the save writer.
242
- * changed variable name `saveOrBlueprintIndicator` to `objectVersion` for objects, since the meaning of that number became now more clear.
167
+ 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`.
243
168
 
169
+ # [Changelog](https://github.com/etothepii4/satisfactory-file-parser/blob/main/CHANGELOG.md).
244
170
 
245
171
  # License
246
172
  MIT License
package/build/index.d.ts CHANGED
@@ -4,8 +4,21 @@ export * from './parser/satisfactory/save/satisfactory-save';
4
4
  export * from './parser/satisfactory/save/save.types';
5
5
  export * from './parser/satisfactory/types/objects/SaveComponent';
6
6
  export * from './parser/satisfactory/types/objects/SaveEntity';
7
- export * from './parser/satisfactory/types/property/generic/ArrayProperty';
8
- export * from './parser/satisfactory/types/property/generic/BasicProperty';
7
+ export * from './parser/satisfactory/types/objects/SaveObject';
8
+ export * from './parser/satisfactory/types/property/generic/AbstractBaseProperty';
9
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty';
10
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty';
11
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty';
12
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty';
13
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty';
14
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty';
15
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty';
16
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty';
17
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty';
18
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty';
19
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty';
20
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty';
21
+ export * from './parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty';
9
22
  export * from './parser/satisfactory/types/property/generic/BoolProperty';
10
23
  export * from './parser/satisfactory/types/property/generic/ByteProperty';
11
24
  export * from './parser/satisfactory/types/property/generic/DoubleProperty';
@@ -16,7 +29,12 @@ export * from './parser/satisfactory/types/property/generic/Int64Property';
16
29
  export * from './parser/satisfactory/types/property/generic/Int8Property';
17
30
  export * from './parser/satisfactory/types/property/generic/MapProperty';
18
31
  export * from './parser/satisfactory/types/property/generic/ObjectProperty';
19
- export * from './parser/satisfactory/types/property/generic/SetProperty';
32
+ export * from './parser/satisfactory/types/property/generic/SetProperty/Int32SetProperty';
33
+ export * from './parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty';
34
+ export * from './parser/satisfactory/types/property/generic/SetProperty/SetProperty';
35
+ export * from './parser/satisfactory/types/property/generic/SetProperty/StrSetProperty';
36
+ export * from './parser/satisfactory/types/property/generic/SetProperty/StructSetProperty';
37
+ export * from './parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty';
20
38
  export * from './parser/satisfactory/types/property/generic/StrProperty';
21
39
  export * from './parser/satisfactory/types/property/generic/StructProperty';
22
40
  export * from './parser/satisfactory/types/property/generic/TextProperty';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,iDAAiD,CAAC;AAChE,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,uCAAuC,CAAC;AACtD,cAAc,mDAAmD,CAAC;AAClE,cAAc,gDAAgD,CAAC;AAC/D,cAAc,4DAA4D,CAAC;AAC3E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,2DAA2D,CAAC;AAC1E,cAAc,2DAA2D,CAAC;AAC1E,cA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AAE,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
@@ -21,8 +21,21 @@ __exportStar(require("./parser/satisfactory/save/satisfactory-save"), exports);
21
21
  __exportStar(require("./parser/satisfactory/save/save.types"), exports);
22
22
  __exportStar(require("./parser/satisfactory/types/objects/SaveComponent"), exports);
23
23
  __exportStar(require("./parser/satisfactory/types/objects/SaveEntity"), exports);
24
- __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty"), exports);
25
- __exportStar(require("./parser/satisfactory/types/property/generic/BasicProperty"), exports);
24
+ __exportStar(require("./parser/satisfactory/types/objects/SaveObject"), exports);
25
+ __exportStar(require("./parser/satisfactory/types/property/generic/AbstractBaseProperty"), exports);
26
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/ArrayProperty"), exports);
27
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/BoolArrayProperty"), exports);
28
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/ByteArrayProperty"), exports);
29
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/DoubleArrayProperty"), exports);
30
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/EnumArrayProperty"), exports);
31
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/FloatArrayProperty"), exports);
32
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/Int32ArrayProperty"), exports);
33
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/Int64ArrayProperty"), exports);
34
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/ObjectArrayProperty"), exports);
35
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/SoftObjectArrayProperty"), exports);
36
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/StrArrayProperty"), exports);
37
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/StructArrayProperty"), exports);
38
+ __exportStar(require("./parser/satisfactory/types/property/generic/ArrayProperty/TextArrayProperty"), exports);
26
39
  __exportStar(require("./parser/satisfactory/types/property/generic/BoolProperty"), exports);
27
40
  __exportStar(require("./parser/satisfactory/types/property/generic/ByteProperty"), exports);
28
41
  __exportStar(require("./parser/satisfactory/types/property/generic/DoubleProperty"), exports);
@@ -33,7 +46,12 @@ __exportStar(require("./parser/satisfactory/types/property/generic/Int64Property
33
46
  __exportStar(require("./parser/satisfactory/types/property/generic/Int8Property"), exports);
34
47
  __exportStar(require("./parser/satisfactory/types/property/generic/MapProperty"), exports);
35
48
  __exportStar(require("./parser/satisfactory/types/property/generic/ObjectProperty"), exports);
36
- __exportStar(require("./parser/satisfactory/types/property/generic/SetProperty"), exports);
49
+ __exportStar(require("./parser/satisfactory/types/property/generic/SetProperty/Int32SetProperty"), exports);
50
+ __exportStar(require("./parser/satisfactory/types/property/generic/SetProperty/ObjectSetProperty"), exports);
51
+ __exportStar(require("./parser/satisfactory/types/property/generic/SetProperty/SetProperty"), exports);
52
+ __exportStar(require("./parser/satisfactory/types/property/generic/SetProperty/StrSetProperty"), exports);
53
+ __exportStar(require("./parser/satisfactory/types/property/generic/SetProperty/StructSetProperty"), exports);
54
+ __exportStar(require("./parser/satisfactory/types/property/generic/SetProperty/Uint32SetProperty"), exports);
37
55
  __exportStar(require("./parser/satisfactory/types/property/generic/StrProperty"), exports);
38
56
  __exportStar(require("./parser/satisfactory/types/property/generic/StructProperty"), exports);
39
57
  __exportStar(require("./parser/satisfactory/types/property/generic/TextProperty"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,kFAAgE;AAChE,yEAAuD;AACvD,+EAA6D;AAC7D,wEAAsD;AACtD,oFAAkE;AAClE,iFAA+D;AAC/D,6FAA2E;AAC3E,6FAA2E;AAC3E,4FAA0E;AAC1E,4FAA0E;AAC1E,8FAA4E;AAC5E,4FAA0E;AAC1E,6FAA2E;AAC3E,6FAA2E;AAC3E,6FAA2E;AAC3E,4FAA0E;AAC1E,2FAAyE;AACzE,8FAA4E;AAC5E,2FAAyE;AACzE,2FAAyE;AACzE,8FAA4E;AAC5E,4FAA0E;AAC1E,8FAA4E;AAC5E,8FAA4E;AAC5E,6FAA2E;AAC3E,sFAAoE;AACpE,mHAAiG;AACjG,wGAAsF;AACtF,mHAAiG;AACjG,yGAAuF;AACvF,sGAAoF;AACpF,4GAA0F;AAC1F,uGAAqF;AACrF,0GAAwF;AACxF,4GAA0F;AAC1F,iGAA+E;AAC/E,wGAAsF;AACtF,2EAAyD;AACzD,iGAA+E;AAC/E,2EAAyD;AACzD,+EAA6D;AAC7D,8EAA4D;AAC5D,mGAAiF;AACjF,sFAAoE;AACpE,0FAAwE;AACxE,gFAA8D;AAC9D,2EAAyD;AACzD,2EAAyD;AACzD,2EAAyD;AAGzD,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,qFAA0G;AAAjG,yHAAA,qBAAqB,OAAA;AAAE,mHAAA,eAAe,OAAA;AAC/C,sEAAoE;AAA3D,yGAAA,UAAU,OAAA;AACnB,sEAAoE;AAA3D,yGAAA,UAAU,OAAA;AACnB,sGAAkG;AAAzF,yIAAA,yBAAyB,OAAA;AAClC,8FAAqF;AAA5E,4HAAA,gBAAgB,OAAA;AAGzB,8DAA4C;AAG5C,0CAAyC;AAAhC,gGAAA,MAAM,OAAA;AACf,0FAAuF;AAA9E,8HAAA,oBAAoB,OAAA;AAG7B,4EAA0D","sourcesContent":["// types & classes for convenience\nexport * from './parser/satisfactory/blueprint/blueprint.types';\nexport * from './parser/satisfactory/save/level.class';\nexport * from './parser/satisfactory/save/satisfactory-save';\nexport * from './parser/satisfactory/save/save.types';\nexport * from './parser/satisfactory/types/objects/SaveComponent';\nexport * from './parser/satisfactory/types/objects/SaveEntity';\nexport * from './parser/satisfactory/types/property/generic/ArrayProperty';\nexport * from './parser/satisfactory/types/property/generic/BasicProperty';\nexport * from './parser/satisfactory/types/property/generic/BoolProperty';\nexport * from './parser/satisfactory/types/property/generic/ByteProperty';\nexport * from './parser/satisfactory/types/property/generic/DoubleProperty';\nexport * from './parser/satisfactory/types/property/generic/EnumProperty';\nexport * from './parser/satisfactory/types/property/generic/FloatProperty';\nexport * from './parser/satisfactory/types/property/generic/Int32Property';\nexport * from './parser/satisfactory/types/property/generic/Int64Property';\nexport * from './parser/satisfactory/types/property/generic/Int8Property';\nexport * from './parser/satisfactory/types/property/generic/MapProperty';\nexport * from './parser/satisfactory/types/property/generic/ObjectProperty';\nexport * from './parser/satisfactory/types/property/generic/SetProperty';\nexport * from './parser/satisfactory/types/property/generic/StrProperty';\nexport * from './parser/satisfactory/types/property/generic/StructProperty';\nexport * from './parser/satisfactory/types/property/generic/TextProperty';\nexport * from './parser/satisfactory/types/property/generic/Uint32Property';\nexport * from './parser/satisfactory/types/property/generic/Uint64Property';\nexport * from './parser/satisfactory/types/property/generic/Uint8Property';\nexport * from './parser/satisfactory/types/property/PropertiesList';\nexport * from './parser/satisfactory/types/property/special/BuildableSubsystemSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/CircuitSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ConveyorChainActorSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ConveyorSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/EmptySpecialProperties';\nexport * from './parser/satisfactory/types/property/special/ObjectsListSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/PlayerSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/PowerLineSpecialProperties';\nexport * from './parser/satisfactory/types/property/special/SpecialDroneActionProperties';\nexport * from './parser/satisfactory/types/property/special/SpecialProperties';\nexport * from './parser/satisfactory/types/property/special/VehicleSpecialProperties';\nexport * from './parser/satisfactory/types/structs/col4';\nexport * from './parser/satisfactory/types/structs/DynamicStructPropertyValue';\nexport * from './parser/satisfactory/types/structs/GUID';\nexport * from './parser/satisfactory/types/structs/GUIDInfo';\nexport * from './parser/satisfactory/types/structs/MD5Hash';\nexport * from './parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange';\nexport * from './parser/satisfactory/types/structs/ObjectReference';\nexport * from './parser/satisfactory/types/structs/SoftObjectReference';\nexport * from './parser/satisfactory/types/structs/Transform';\nexport * from './parser/satisfactory/types/structs/vec2';\nexport * from './parser/satisfactory/types/structs/vec3';\nexport * from './parser/satisfactory/types/structs/vec4';\n\n// should better be removed in a future update to prevent shenanigans.\nexport { BlueprintConfigReader, BlueprintReader } from './parser/satisfactory/blueprint/blueprint-reader';\nexport { BlueprintConfigWriter, BlueprintWriter } from './parser/satisfactory/blueprint/blueprint-writer';\nexport { SaveReader } from './parser/satisfactory/save/save-reader';\nexport { SaveWriter } from './parser/satisfactory/save/save-writer';\nexport { SaveStreamJsonStringifier } from './parser/stream/reworked/save-stream-json-stringifier';\nexport { SaveStreamWriter } from './parser/stream/reworked/save-stream-writer.class';\n\n// errors\nexport * from './parser/error/parser.error';\n\n// facade\nexport { Parser } from './parser/parser';\nexport { ReadableStreamParser } from './parser/stream/reworked/readable-stream-parser';\n\n// edit\nexport * from './parser/satisfactory/edit/edit-constants';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,kFAAgE;AAChE,yEAAuD;AACvD,+EAA6D;AAC7D,wEAAsD;AACtD,oFAAkE;AAClE,iFAA+D;AAC/D,iFAA+D;AAC/D,oGAAkF;AAClF,2GAAyF;AACzF,+GAA6F;AAC7F,+GAA6F;AAC7F,iHAA+F;AAC/F,+GAA6F;AAC7F,gHAA8F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cesContent":["// types & classes for convenience\nexport * from './parser/satisfactory/blueprint/blueprint.types';\nexport * from './parser/satisfactory/save/level.class';\nexport * from './parser/satisfactory/save/satisfactory-save';\nexport * from './parser/satisfactory/save/save.types';\nexport * from './parser/satisfactory/types/objects/SaveComponent';\nexport * from './parser/satisfactory/types/objects/SaveEntity';\nexport * from './parser/satisfactory/types/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/SpecialDroneActionProperties';\nexport * from './parser/satisfactory/types/property/special/SpecialProperties';\nexport * from './parser/satisfactory/types/property/special/VehicleSpecialProperties';\nexport * from './parser/satisfactory/types/structs/col4';\nexport * from './parser/satisfactory/types/structs/DynamicStructPropertyValue';\nexport * from './parser/satisfactory/types/structs/GUID';\nexport * from './parser/satisfactory/types/structs/GUIDInfo';\nexport * from './parser/satisfactory/types/structs/MD5Hash';\nexport * from './parser/satisfactory/types/structs/mods/FicsItCam/FICFrameRange';\nexport * from './parser/satisfactory/types/structs/ObjectReference';\nexport * from './parser/satisfactory/types/structs/SoftObjectReference';\nexport * from './parser/satisfactory/types/structs/Transform';\nexport * from './parser/satisfactory/types/structs/vec2';\nexport * from './parser/satisfactory/types/structs/vec3';\nexport * from './parser/satisfactory/types/structs/vec4';\n\n// should better be removed in a future update to prevent shenanigans.\nexport { BlueprintConfigReader, BlueprintReader } from './parser/satisfactory/blueprint/blueprint-reader';\nexport { BlueprintConfigWriter, BlueprintWriter } from './parser/satisfactory/blueprint/blueprint-writer';\nexport { SaveReader } from './parser/satisfactory/save/save-reader';\nexport { SaveWriter } from './parser/satisfactory/save/save-writer';\nexport { SaveStreamJsonStringifier } from './parser/stream/reworked/save-stream-json-stringifier';\nexport { SaveStreamWriter } from './parser/stream/reworked/save-stream-writer.class';\n\n// errors\nexport * from './parser/error/parser.error';\n\n// facade\nexport { Parser } from './parser/parser';\nexport { ReadableStreamParser } from './parser/stream/reworked/readable-stream-parser';\n\n// edit\nexport * from './parser/satisfactory/edit/edit-constants';\n\n"]}
@@ -12,7 +12,7 @@ export declare abstract class ByteReader implements BinaryReadable {
12
12
  skipBytes(byteLength?: number): void;
13
13
  readByte(): number;
14
14
  readBytes(count: number): Uint8Array;
15
- private uint8ToHexRepresentation;
15
+ bytesToHexRepresentation(bytes: number[]): string[];
16
16
  readHex(byteLength: number, hexSeparator?: string): string;
17
17
  readInt8(): number;
18
18
  readUint8(): number;
@@ -1 +1 @@
1
- {"version":3,"file":"byte-reader.class.d.ts","sourceRoot":"","sources":["../../../src/parser/byte/byte-reader.class.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAG7D,8BAAsB,UAAW,YAAW,cAAc;IAEzD,SAAS,CAAC,UAAU,EAAG,QAAQ,CAAC;IAChC,SAAS,CAAC,UAAU,EAAG,WAAW,CAAC;IAC5B,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AQ,CAAC;IAChC,SAAS,CAAC,UAAU,EAAG,WAAW,CAAC;IAC5B,SAAS,EAAE,SAAS,CAAC;IAE5B,SAAS,CAAC,WAAW,EAAE,MAAM,CAAK;IAClC,SAAS,CAAC,WAAW,EAAE,MAAM,CAAK;IAClC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAK;gBAElB,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS;IASlD,KAAK,CAAC,aAAa,EAAE,WAAW;IAWhC,SAAS,CAAC,UAAU,SAAI,GAAG,IAAI;IAI/B,QAAQ,IAAI,MAAM;IAIlB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU;IAGpC,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAGnD,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,GAAE,MAAY,GAAG,MAAM;IAG/D,QAAQ,IAAI,MAAM;IAIlB,SAAS,IAAI,MAAM;IAInB,SAAS,IAAI,MAAM;IAKnB,UAAU,IAAI,MAAM;IAKpB,SAAS,IAAI,MAAM;IAKnB,UAAU,IAAI,MAAM;IAKpB,QAAQ,IAAI,MAAM;IAKlB,SAAS,IAAI,MAAM;IAGnB,UAAU,IAAI,MAAM;IAMpB,WAAW,IAAI,MAAM;IAKrB,UAAU,IAAI,MAAM;IAKpB,UAAU,IAAI,MAAM;IAgCpB,iBAAiB,QAAO,MAAM,CAAqB;IAEnD,cAAc,UAAW,MAAM,OAAO,MAAM,GAAG,SAAS,KAAG,WAAW,CAA6C;IAEnH,iBAAiB,QAAO,MAAM,CAAyD;IAEvF,eAAe,QAAO,MAAM,CAAsC;IAElE,SAAS,QAAO,WAAW,CAA2B;CAC7D"}
@@ -33,11 +33,11 @@ class ByteReader {
33
33
  readBytes(count) {
34
34
  return new Uint8Array(new Array(count).fill(0).map(pl => this.bufferView.getUint8(this.currentByte++)));
35
35
  }
36
- uint8ToHexRepresentation(byte) {
37
- return ('0' + byte.toString(16)).slice(-2);
36
+ bytesToHexRepresentation(bytes) {
37
+ return bytes.map(byte => ('0' + byte.toString(16)).slice(-2));
38
38
  }
39
- readHex(byteLength, hexSeparator = '') {
40
- return Array.from(this.readBytes(byteLength)).map(byte => this.uint8ToHexRepresentation(byte)).join(hexSeparator);
39
+ readHex(byteLength, hexSeparator = ' ') {
40
+ return this.bytesToHexRepresentation(Array.from(this.readBytes(byteLength))).join(hexSeparator);
41
41
  }
42
42
  readInt8() {
43
43
  let data = this.bufferView.getInt8(this.currentByte++);
@@ -1 +1 @@
1
- {"version":3,"file":"byte-reader.class.js","sourceRoot":"","sources":["../../../src/parser/byte/byte-reader.class.ts"],"names":[],"mappings":";;;AAAA,wDAAyD;AACzD,qDAA6C;AAI7C,MAAsB,UAAU;IAU/B,YAAY,UAAuB,EAAE,SAAoB;QAJ/C,gBAAW,GAAW,CAAC,CAAC;QACxB,gBAAW,GAAW,CAAC,CAAC;QACxB,YAAO,GAAW,CAAC,CAAC;QA2HvB,sBAAiB,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC;QAEnD,mBAAc,GAAG,CAAC,KAAa,EAAE,GAAuB,EAAe,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEnH,sBAAiB,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC;QAEvF,oBAAe,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC;QAElE,cAAS,GAAG,GAAgB,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;QAhI5D,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxB,CAAC;IAMM,KAAK,CAAC,aAA0B;QACtC,IAAI,CA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AI,YAAY,GAAG,gCAAgC,SAAS,gBAAgB,IAAI,CAAC,WAAW,6BAA6B,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAC7J,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,CAAC;QAC/B,CAAC;QAGD,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;YACnG,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;YACtB,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB,CAAC;QAGD,IAAI,CAAC;YACJ,MAAM,MAAM,GAAG,IAAI,KAAK,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;YACjG,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;YACtB,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,KAAK,EAAE,CAAC;YACd,MAAM,IAAI,+BAAgB,CAAC,qCAAqC,SAAS,gBAAgB,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;QAC/G,CAAC;IACF,CAAC;CAWD;AA5ID,gCA4IC","sourcesContent":["import { CorruptSaveError } from '../error/parser.error';\nimport { Alignment } from \"./alignment.enum\";\nimport { BinaryReadable } from \"./binary-readable.interface\";\n\n/** @public */\nexport abstract class ByteReader implements BinaryReadable {\n\n\tprotected bufferView!: DataView;\n\tprotected fileBuffer!: ArrayBuffer;\n\tpublic alignment: Alignment;\n\n\tprotected currentByte: number = 0;\n\tprotected handledByte: number = 0;\n\tprotected maxByte: number = 0;\n\n\tconstructor(fileBuffer: ArrayBuffer, alignment: Alignment) {\n\t\tthis.alignment = alignment;\n\t\tthis.reset(fileBuffer);\n\t}\n\n\t/**\n\t * Resets the reader on the given arraybuffer to start from the beginning.\n\t * @param newFileBuffer the new array buffer to be read.\n\t */\n\tpublic reset(newFileBuffer: ArrayBuffer) {\n\t\tthis.fileBuffer = newFileBuffer;\n\t\tthis.bufferView = new DataView(newFileBuffer, 0, this.fileBuffer.byteLength);\n\t\tthis.maxByte = newFileBuffer.byteLength;\n\t\tthis.currentByte = 0;\n\t\tthis.handledByte = 0;\n\t}\n\n\t/*\n\t * Byte Manipulation\n\t */\n\tpublic skipBytes(byteLength = 1): void {\n\t\tthis.currentByte += byteLength;\n\t\treturn;\n\t}\n\tpublic readByte(): number {\n\t\t// TODO can i not just readByte() ??\n\t\treturn parseInt(this.bufferView.getUint8(this.currentByte++).toString());\n\t}\n\tpublic readBytes(count: number): Uint8Array {\n\t\treturn new Uint8Array(new Array(count).fill(0).map(pl => this.bufferView.getUint8(this.currentByte++)));\n\t}\n\tprivate uint8ToHexRepresentation(byte: number): string {\n\t\treturn ('0' + byte.toString(16)).slice(-2);\n\t}\n\tpublic readHex(byteLength: number, hexSeparator: string = ''): string {\n\t\treturn Array.from(this.readBytes(byteLength)).map(byte => this.uint8ToHexRepresentation(byte)).join(hexSeparator);\n\t}\n\tpublic readInt8(): number {\n\t\tlet data = this.bufferView.getInt8(this.currentByte++);\n\t\treturn data;\n\t}\n\tpublic readUint8(): number {\n\t\tlet data = this.bufferView.getUint8(this.currentByte++);\n\t\treturn data;\n\t}\n\tpublic readInt16(): number {\n\t\tlet data = this.bufferView.getInt16(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 2;\n\t\treturn data;\n\t}\n\tpublic readUint16(): number {\n\t\tlet data = this.bufferView.getUint16(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 2;\n\t\treturn data;\n\t}\n\tpublic readInt32(): number {\n\t\tlet data = this.bufferView.getInt32(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t\treturn data;\n\t}\n\tpublic readUint32(): number {\n\t\tlet data = this.bufferView.getUint32(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t\treturn data;\n\t}\n\tpublic readLong(): bigint {\n\t\tlet data = this.bufferView.getBigInt64(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t\treturn data;\n\t}\n\tpublic readInt64(): bigint {\n\t\treturn this.readLong();\n\t}\n\tpublic readUint64(): bigint {\n\t\tlet data = this.bufferView.getBigUint64(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t\treturn data;\n\t}\n\n\tpublic readFloat32(): number {\n\t\tlet data = this.bufferView.getFloat32(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t\treturn data;\n\t}\n\tpublic readDouble(): number {\n\t\tlet data = this.bufferView.getFloat64(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t\treturn data;\n\t}\n\tpublic readString(): string {\n\t\tlet strLength = this.readInt32();\n\t\tlet startBytes = this.currentByte;\n\n\t\tif (strLength === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Range error!\n\t\tif (strLength > (this.bufferView.buffer.byteLength - this.currentByte)) {\n\t\t\tlet errorMessage = `Cannot read string of length ${strLength} at position ${this.currentByte} as it exceeds the end at ${this.bufferView.buffer.byteLength}`;\n\t\t\tthrow new Error(errorMessage);\n\t\t}\n\n\t\t// it uses UTF16 if text is non-ascii, even if it would fit into UTF8.\n\t\tif (strLength < 0) {\n\t\t\tconst string = new Array(-strLength - 1).fill('').map(c => String.fromCharCode(this.readUint16()));\n\t\t\tthis.currentByte += 2;\n\t\t\treturn string.join('');\n\t\t}\n\n\t\t//default UTF-8\n\t\ttry {\n\t\t\tconst string = new Array(strLength - 1).fill('').map(c => String.fromCharCode(this.readUint8()));\n\t\t\tthis.currentByte += 1;\n\t\t\treturn string.join('');\n\t\t}\n\t\tcatch (error) {\n\t\t\tthrow new CorruptSaveError(`Cannot read UTF8 string of length ${strLength} at position ${this.currentByte}.`);\n\t\t}\n\t}\n\n\tpublic getBufferPosition = (): number => this.currentByte;\n\n\tpublic getBufferSlice = (begin: number, end: number | undefined): ArrayBuffer => this.bufferView.buffer.slice(begin, end);\n\n\tpublic getBufferProgress = (): number => this.currentByte / this.bufferView.buffer.byteLength;\n\n\tpublic getBufferLength = (): number => this.bufferView.buffer.byteLength;\n\n\tpublic getBuffer = (): ArrayBuffer => this.bufferView.buffer;\n}"]}
1
+ {"version":3,"file":"byte-reader.class.js","sourceRoot":"","sources":["../../../src/parser/byte/byte-reader.class.ts"],"names":[],"mappings":";;;AAAA,wDAAyD;AACzD,qDAA6C;AAI7C,MAAsB,UAAU;IAU/B,YAAY,UAAuB,EAAE,SAAoB;QAJ/C,gBAAW,GAAW,CAAC,CAAC;QACxB,gBAAW,GAAW,CAAC,CAAC;QACxB,YAAO,GAAW,CAAC,CAAC;QA2HvB,sBAAiB,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC;QAEnD,mBAAc,GAAG,CAAC,KAAa,EAAE,GAAuB,EAAe,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAEnH,sBAAiB,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC;QAEvF,oBAAe,GAAG,GAAW,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC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AAC;CAWD;AA5ID,gCA4IC","sourcesContent":["import { CorruptSaveError } from '../error/parser.error';\nimport { Alignment } from \"./alignment.enum\";\nimport { BinaryReadable } from \"./binary-readable.interface\";\n\n/** @public */\nexport abstract class ByteReader implements BinaryReadable {\n\n\tprotected bufferView!: DataView;\n\tprotected fileBuffer!: ArrayBuffer;\n\tpublic alignment: Alignment;\n\n\tprotected currentByte: number = 0;\n\tprotected handledByte: number = 0;\n\tprotected maxByte: number = 0;\n\n\tconstructor(fileBuffer: ArrayBuffer, alignment: Alignment) {\n\t\tthis.alignment = alignment;\n\t\tthis.reset(fileBuffer);\n\t}\n\n\t/**\n\t * Resets the reader on the given arraybuffer to start from the beginning.\n\t * @param newFileBuffer the new array buffer to be read.\n\t */\n\tpublic reset(newFileBuffer: ArrayBuffer) {\n\t\tthis.fileBuffer = newFileBuffer;\n\t\tthis.bufferView = new DataView(newFileBuffer, 0, this.fileBuffer.byteLength);\n\t\tthis.maxByte = newFileBuffer.byteLength;\n\t\tthis.currentByte = 0;\n\t\tthis.handledByte = 0;\n\t}\n\n\t/*\n\t * Byte Manipulation\n\t */\n\tpublic skipBytes(byteLength = 1): void {\n\t\tthis.currentByte += byteLength;\n\t\treturn;\n\t}\n\tpublic readByte(): number {\n\t\t// TODO can i not just readByte() ??\n\t\treturn parseInt(this.bufferView.getUint8(this.currentByte++).toString());\n\t}\n\tpublic readBytes(count: number): Uint8Array {\n\t\treturn new Uint8Array(new Array(count).fill(0).map(pl => this.bufferView.getUint8(this.currentByte++)));\n\t}\n\tpublic bytesToHexRepresentation(bytes: number[]): string[] {\n\t\treturn bytes.map(byte => ('0' + byte.toString(16)).slice(-2));\n\t}\n\tpublic readHex(byteLength: number, hexSeparator: string = ' '): string {\n\t\treturn this.bytesToHexRepresentation(Array.from(this.readBytes(byteLength))).join(hexSeparator);\n\t}\n\tpublic readInt8(): number {\n\t\tlet data = this.bufferView.getInt8(this.currentByte++);\n\t\treturn data;\n\t}\n\tpublic readUint8(): number {\n\t\tlet data = this.bufferView.getUint8(this.currentByte++);\n\t\treturn data;\n\t}\n\tpublic readInt16(): number {\n\t\tlet data = this.bufferView.getInt16(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 2;\n\t\treturn data;\n\t}\n\tpublic readUint16(): number {\n\t\tlet data = this.bufferView.getUint16(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 2;\n\t\treturn data;\n\t}\n\tpublic readInt32(): number {\n\t\tlet data = this.bufferView.getInt32(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t\treturn data;\n\t}\n\tpublic readUint32(): number {\n\t\tlet data = this.bufferView.getUint32(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t\treturn data;\n\t}\n\tpublic readLong(): bigint {\n\t\tlet data = this.bufferView.getBigInt64(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t\treturn data;\n\t}\n\tpublic readInt64(): bigint {\n\t\treturn this.readLong();\n\t}\n\tpublic readUint64(): bigint {\n\t\tlet data = this.bufferView.getBigUint64(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t\treturn data;\n\t}\n\n\tpublic readFloat32(): number {\n\t\tlet data = this.bufferView.getFloat32(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 4;\n\t\treturn data;\n\t}\n\tpublic readDouble(): number {\n\t\tlet data = this.bufferView.getFloat64(this.currentByte, this.alignment === Alignment.LITTLE_ENDIAN);\n\t\tthis.currentByte += 8;\n\t\treturn data;\n\t}\n\tpublic readString(): string {\n\t\tlet strLength = this.readInt32();\n\t\tlet startBytes = this.currentByte;\n\n\t\tif (strLength === 0) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Range error!\n\t\tif (strLength > (this.bufferView.buffer.byteLength - this.currentByte)) {\n\t\t\tlet errorMessage = `Cannot read string of length ${strLength} at position ${this.currentByte} as it exceeds the end at ${this.bufferView.buffer.byteLength}`;\n\t\t\tthrow new Error(errorMessage);\n\t\t}\n\n\t\t// it uses UTF16 if text is non-ascii, even if it would fit into UTF8.\n\t\tif (strLength < 0) {\n\t\t\tconst string = new Array(-strLength - 1).fill('').map(c => String.fromCharCode(this.readUint16()));\n\t\t\tthis.currentByte += 2;\n\t\t\treturn string.join('');\n\t\t}\n\n\t\t//default UTF-8\n\t\ttry {\n\t\t\tconst string = new Array(strLength - 1).fill('').map(c => String.fromCharCode(this.readUint8()));\n\t\t\tthis.currentByte += 1;\n\t\t\treturn string.join('');\n\t\t}\n\t\tcatch (error) {\n\t\t\tthrow new CorruptSaveError(`Cannot read UTF8 string of length ${strLength} at position ${this.currentByte}.`);\n\t\t}\n\t}\n\n\tpublic getBufferPosition = (): number => this.currentByte;\n\n\tpublic getBufferSlice = (begin: number, end: number | undefined): ArrayBuffer => this.bufferView.buffer.slice(begin, end);\n\n\tpublic getBufferProgress = (): number => this.currentByte / this.bufferView.buffer.byteLength;\n\n\tpublic getBufferLength = (): number => this.bufferView.buffer.byteLength;\n\n\tpublic getBuffer = (): ArrayBuffer => this.bufferView.buffer;\n}"]}
@@ -2,7 +2,7 @@ import { ChunkSummary } from "./file.types";
2
2
  import { Blueprint } from "./satisfactory/blueprint/blueprint.types";
3
3
  import { SatisfactorySave } from "./satisfactory/save/satisfactory-save";
4
4
  export declare class Parser {
5
- static ParseSave(name: string, bytes: Uint8Array, options?: Partial<{
5
+ static ParseSave(name: string, bytes: ArrayBuffer, options?: Partial<{
6
6
  onDecompressedSaveBody: (buffer: ArrayBuffer) => void;
7
7
  onProgressCallback: (progress: number, msg?: string) => void;
8
8
  }>): SatisfactorySave;
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAA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CAAA;KAC7B;WAuCa,mBAAmB,CAChC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,EACrB,mBAAmB,EAAE,MAAM,EAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;QACjB,2BAA2B,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAA;KAC1D,CAAC,GACA,SAAS;IAmCZ,OAAc,qBAAqB,QAAS,GAAG,WAAU,MAAM,KAAO,MAAM,CAQjE;CAEX"}
@@ -9,7 +9,7 @@ const save_reader_1 = require("./satisfactory/save/save-reader");
9
9
  const save_writer_1 = require("./satisfactory/save/save-writer");
10
10
  class Parser {
11
11
  static ParseSave(name, bytes, options) {
12
- const reader = new save_reader_1.SaveReader(bytes.buffer, options?.onProgressCallback);
12
+ const reader = new save_reader_1.SaveReader(bytes, options?.onProgressCallback);
13
13
  const header = reader.readHeader();
14
14
  const save = new satisfactory_save_1.SatisfactorySave(name, header);
15
15
  const roughSaveVersion = save_reader_1.SaveReader.GetRoughSaveVersion(header.saveVersion, header.saveHeaderType);
@@ -1 +1 @@
1
- {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAE/D,gFAAmG;AACnG,gFAAmG;AAEnG,6EAAyE;AACzE,iEAA6D;AAC7D,iEAA6D;AAI7D,MAAa,MAAM;IASX,MAAM,CAAC,SAAS,CACtB,IAAY,EACZ,KAAiB,EACjB,OAGE;QAGF,MAAM,MAAM,GAAG,IAAI,wBAAU,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAEzE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,IAAI,oCAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAGhD,MAAM,gBAAgB,GAAG,wBAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,c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EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC,EAAE,MAAM,CAAC,CAAA","sourcesContent":["import { UnsupportedVersionError } from './error/parser.error';\nimport { ChunkSummary } from \"./file.types\";\nimport { BlueprintConfigReader, BlueprintReader } from \"./satisfactory/blueprint/blueprint-reader\";\nimport { BlueprintConfigWriter, BlueprintWriter } from \"./satisfactory/blueprint/blueprint-writer\";\nimport { Blueprint } from \"./satisfactory/blueprint/blueprint.types\";\nimport { SatisfactorySave } from \"./satisfactory/save/satisfactory-save\";\nimport { SaveReader } from './satisfactory/save/save-reader';\nimport { SaveWriter } from \"./satisfactory/save/save-writer\";\n\n\n/** @public */\nexport class Parser {\n\n\t/**\n\t * Parses a given binary buffer as {@link SatisfactorySave}\n\t * @param name the save name. It won't be serialized, so it does not matter how you name it.\n\t * @param bytes the actual binary buffer\n\t * @param options provides callbacks. Either on the decompressed save body or on reported progress as a number [0,1] with an occasional message.\n\t * @returns \n\t */\n\tpublic static ParseSave(\n\t\tname: string,\n\t\tbytes: Uint8Array,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBuffer) => void,\n\t\t\tonProgressCallback: (progress: number, msg?: string) => void\n\t\t}>\n\t): SatisfactorySave {\n\n\t\tconst reader = new SaveReader(bytes.buffer, options?.onProgressCallback);\n\n\t\tconst header = reader.readHeader();\n\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion, header.saveHeaderType);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported.');\n\t\t} else if (roughSaveVersion === 'U6/U7') {\n\t\t\tthrow new UnsupportedVersionError('Game Version U6/U7 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.0.34');\n\t\t} else if (roughSaveVersion === 'U8') {\n\t\t\tthrow new UnsupportedVersionError('Game Version U8 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.3.7');\n\t\t}\n\n\t\t// inflate chunks\n\t\tconst inflateResult = reader.inflateChunks();\n\t\tsave.compressionInfo = reader.compressionInfo;\n\n\t\t// call callback on decompressed save body\n\t\tif (options?.onDecompressedSaveBody !== undefined) {\n\t\t\toptions.onDecompressedSaveBody(reader.getBuffer());\n\t\t}\n\n\t\t// save body validation hash\n\t\tsave.gridHash = reader.readSaveBodyHash();\n\n\t\t// parse grids\n\t\tsave.grids = reader.readGrids();\n\n\t\t// parse levels\n\t\tsave.levels = reader.readLevels();\n\n\t\treturn save;\n\t}\n\n\t/**\n\t * serializes a {@link SatisfactorySave} into binary and reports back on individual callbacks.\n\t * @param save the {@link SatisfactorySave} to serialize into binary.\n\t * @param options provides callbacks. onBinaryBeforeCompressing gets called on the binary save body before it is compressed.\n\t * onHeader gets called on the binary save header, which is always uncompressed.\n\t * onChunk gets called when a chunk of the compressed save body was generated. Often, files' save bodies consist of multiple chunks.\n\t * @returns a summary of the generated chunks.\n\t */\n\tpublic static WriteSave(save: SatisfactorySave,\n\t\tonHeader: (header: Uint8Array) => void,\n\t\tonChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonBinaryBeforeCompressing: (buffer: ArrayBuffer) => void,\n\t\t}>\n\t): ChunkSummary[] {\n\n\t\tconst writer = new SaveWriter();\n\n\t\tSaveWriter.WriteHeader(writer, save.header);\n\t\tconst posAfterHeader = writer.getBufferPosition();\n\n\t\tSaveWriter.WriteSaveBodyHash(writer, save.gridHash);\n\t\tSaveWriter.WriteGrids(writer, save.grids);\n\t\tSaveWriter.WriteLevels(writer, save, save.header.buildVersion);\n\n\t\twriter.endWriting();\n\t\tconst chunkSummary = writer.generateChunks(save.compressionInfo!, posAfterHeader, options?.onBinaryBeforeCompressing ?? (() => { }), onHeader, onChunk);\n\t\treturn chunkSummary;\n\t}\n\n\t/**\n\t * Writes a {@link Blueprint} object to binary. And reports back on individual callbacks.\n\t * @param blueprint the blueprint to be written\n\t * @param options onMainFileBinaryBeforeCompressing gets called back when the main blueprint file binary is ready before compressing.\n\t * onMainFileHeader gets called back when the main blueprint file header is ready. onMainFileChunk gets called back when a main blueprint file chunk is ready.\n\t * @returns a chunk summary of the main file generated chunks. Plus the binary data of the config file, since it is often very small.\n\t */\n\tpublic static WriteBlueprintFiles(\n\t\tblueprint: Blueprint,\n\t\tonMainFileHeader: (header: Uint8Array) => void,\n\t\tonMainFileChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonMainFileBinaryBeforeCompressing: (binary: ArrayBuffer) => void,\n\t\t}>\n\t): {\n\t\tmainFileChunkSummary: ChunkSummary[],\n\t\tconfigFileBinary: ArrayBuffer\n\t} {\n\n\t\t// write main blueprint file\n\t\tconst blueprintWriter = new BlueprintWriter();\n\t\tBlueprintWriter.SerializeHeader(blueprintWriter, blueprint.header);\n\t\tconst saveBodyPos = blueprintWriter.getBufferPosition();\n\t\tBlueprintWriter.SerializeObjects(blueprintWriter, blueprint.objects);\n\t\tblueprintWriter.endWriting();\n\t\tlet binaryChunks: Uint8Array[] = [];\n\t\tlet binaryHeader: Uint8Array;\n\t\tconst mainFileChunkSummary = blueprintWriter.generateChunks(\n\t\t\tblueprint.compressionInfo,\n\t\t\tsaveBodyPos,\n\t\t\t{\n\t\t\t\tonBinaryBeforeCompressing: options?.onMainFileBinaryBeforeCompressing ?? (() => { }),\n\t\t\t\tonHeader: onMainFileHeader,\n\t\t\t\tonChunk: onMainFileChunk\n\t\t\t}\n\t\t);\n\n\t\t// write config as well.\n\t\tconst configWriter = new BlueprintConfigWriter();\n\t\tBlueprintConfigWriter.SerializeConfig(configWriter, blueprint.config);\n\t\tconst configFileBinary = configWriter.endWriting();\n\n\t\treturn {\n\t\t\tmainFileChunkSummary,\n\t\t\tconfigFileBinary\n\t\t}\n\t}\n\n\t/**\n\t * Parses two buffers (main blueprint file + config file) into a {@link Blueprint object}\n\t * @param name the name of the blueprint, since it is not part of the binary data and has to be passed.\n\t * @param blueprintFile the main blueprint file \".sbp\"\n\t * @param blueprintConfigFile the config blueprint file \".sbpcfg\"\n\t * @param options provides callbacks. onDecompressedBlueprintBody gets called when the body of the main blueprint file is decompressed.\n\t * @returns \n\t */\n\tpublic static ParseBlueprintFiles(\n\t\tname: string,\n\t\tblueprintFile: Buffer,\n\t\tblueprintConfigFile: Buffer,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedBlueprintBody: (buffer: ArrayBuffer) => void\n\t\t}>\n\t): Blueprint {\n\n\t\t// read config file\n\t\tconst blueprintConfigReader = new BlueprintConfigReader(new Uint8Array(blueprintConfigFile).buffer);\n\t\tconst config = BlueprintConfigReader.ParseConfig(blueprintConfigReader);\n\n\t\t// read actual blueprint file\n\t\tconst blueprintReader = new BlueprintReader(new Uint8Array(blueprintFile).buffer);\n\t\tconst header = BlueprintReader.ReadHeader(blueprintReader);\n\t\tconst inflateResult = blueprintReader.inflateChunks();\n\n\t\t// call back on decompressed body.\n\t\tif (options?.onDecompressedBlueprintBody !== undefined) {\n\t\t\toptions.onDecompressedBlueprintBody(inflateResult.inflatedData);\n\t\t}\n\n\t\tconst blueprintObjects = BlueprintReader.ParseObjects(blueprintReader);\n\t\tconst blueprint: Blueprint = {\n\t\t\tname,\n\t\t\tcompressionInfo: blueprintReader.compressionInfo,\n\t\t\theader: header,\n\t\t\tconfig,\n\t\t\tobjects: blueprintObjects\n\t\t};\n\t\treturn blueprint;\n\t}\n\n\t/**\n\t * It JSON.stringifies any parsed content safely. The original JSON.stringify() has some flaws that get in the way, so it is custom wrapped. The original has some problems:\n\t * 1. it cannot stringify bigints. So we help out by converting it into a string.\n\t * 2. It cannot distinguish between 0 and -0. But a float32 is encoded in a uint8Array for 0 to be [0,0,0,0] (0x00000000) and -0 to be [0,0,0,128] (0x00000080) in little endian.\n\t * @param obj basically anything that can be stringified\n\t * @param indent the indentation, just like with the real JSON stringify.\n\t * @returns a string that is safely stringified.\n\t */\n\tpublic static JSONStringifyModified = (obj: any, indent: number = 0): string =>\n\t\tJSON.stringify(obj, (key, value) => {\n\t\t\tif (typeof value === 'bigint') {\n\t\t\t\treturn value.toString();\n\t\t\t} else if (value === 0 && 1 / value < 0) {\t// -0\n\t\t\t\treturn '-0';\n\t\t\t}\n\t\t\treturn value;\n\t\t}, indent)\n\n}"]}
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../src/parser/parser.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAE/D,gFAAmG;AACnG,gFAAmG;AAEnG,6EAAyE;AACzE,iEAA6D;AAC7D,iEAA6D;AAI7D,MAAa,MAAM;IASX,MAAM,CAAC,SAAS,CACtB,IAAY,EACZ,KAAkB,EAClB,OAGE;QAGF,MAAM,MAAM,GAAG,IAAI,wBAAU,CAAC,KAAK,EAAE,OAAO,EAAE,kBAAkB,CAAC,CAAC;QAElE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;QACnC,MAAM,IAAI,GAAG,IAAI,oCAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAGhD,MAAM,gBAAgB,GAAG,wBAAU,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;QACnG,IAAI,gBAAgB,KAAK,KAAK,EAAE,CAAC;YAChC,MAAM,IAAI,sCAAuB,CAAC,qCAAqC,CAAC,CAAC;QAC1E,CAAC;aAAM,IAAI,gBAAgB,KAAK,OAAO,EAAE,CAAC;YACzC,MAAM,IAAI,sCAAuB,CAAC,gJAAgJ,CAAC,CAAC;QACrL,CAAC;aAAM,IAAI,gBAAgB,KAAK,IAAI,EAAE,CAAC;YACtC,MAAM,IAAI,sCAAuB,CAAC,4IAA4I,CAAC,CAAC;QACjL,CAAC;QAGD,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,EAAE,CAAC;QAC7C,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAA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,CAAC;QAC3D,MAAM,aAAa,GAAG,eAAe,CAAC,aAAa,EAAE,CAAC;QAGtD,IAAI,OAAO,EAAE,2BAA2B,KAAK,SAAS,EAAE,CAAC;YACxD,OAAO,CAAC,2BAA2B,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,gBAAgB,GAAG,kCAAe,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;QACvE,MAAM,SAAS,GAAc;YAC5B,IAAI;YACJ,eAAe,EAAE,eAAe,CAAC,eAAe;YAChD,MAAM,EAAE,MAAM;YACd,MAAM;YACN,OAAO,EAAE,gBAAgB;SACzB,CAAC;QACF,OAAO,SAAS,CAAC;IAClB,CAAC;;AA5KF,wBAgMC;AAVc,4BAAqB,GAAG,CAAC,GAAQ,EAAE,SAAiB,CAAC,EAAU,EAAE,CAC9E,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;SAAM,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC,EAAE,MAAM,CAAC,CAAA","sourcesContent":["import { UnsupportedVersionError } from './error/parser.error';\nimport { ChunkSummary } from \"./file.types\";\nimport { BlueprintConfigReader, BlueprintReader } from \"./satisfactory/blueprint/blueprint-reader\";\nimport { BlueprintConfigWriter, BlueprintWriter } from \"./satisfactory/blueprint/blueprint-writer\";\nimport { Blueprint } from \"./satisfactory/blueprint/blueprint.types\";\nimport { SatisfactorySave } from \"./satisfactory/save/satisfactory-save\";\nimport { SaveReader } from './satisfactory/save/save-reader';\nimport { SaveWriter } from \"./satisfactory/save/save-writer\";\n\n\n/** @public */\nexport class Parser {\n\n\t/**\n\t * Parses a given binary buffer as {@link SatisfactorySave}\n\t * @param name the save name. It won't be serialized, so it does not matter how you name it.\n\t * @param bytes the actual binary buffer\n\t * @param options provides callbacks. Either on the decompressed save body or on reported progress as a number [0,1] with an occasional message.\n\t * @returns \n\t */\n\tpublic static ParseSave(\n\t\tname: string,\n\t\tbytes: ArrayBuffer,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedSaveBody: (buffer: ArrayBuffer) => void,\n\t\t\tonProgressCallback: (progress: number, msg?: string) => void\n\t\t}>\n\t): SatisfactorySave {\n\n\t\tconst reader = new SaveReader(bytes, options?.onProgressCallback);\n\n\t\tconst header = reader.readHeader();\n\t\tconst save = new SatisfactorySave(name, header);\n\n\t\t// guard save version\n\t\tconst roughSaveVersion = SaveReader.GetRoughSaveVersion(header.saveVersion, header.saveHeaderType);\n\t\tif (roughSaveVersion === '<U6') {\n\t\t\tthrow new UnsupportedVersionError('Game Version < U6 is not supported.');\n\t\t} else if (roughSaveVersion === 'U6/U7') {\n\t\t\tthrow new UnsupportedVersionError('Game Version U6/U7 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.0.34');\n\t\t} else if (roughSaveVersion === 'U8') {\n\t\t\tthrow new UnsupportedVersionError('Game Version U8 is not supported in this package version. Consider downgrading to the latest package version supporting it, which is 0.3.7');\n\t\t}\n\n\t\t// inflate chunks\n\t\tconst inflateResult = reader.inflateChunks();\n\t\tsave.compressionInfo = reader.compressionInfo;\n\n\t\t// call callback on decompressed save body\n\t\tif (options?.onDecompressedSaveBody !== undefined) {\n\t\t\toptions.onDecompressedSaveBody(reader.getBuffer());\n\t\t}\n\n\t\t// save body validation hash\n\t\tsave.gridHash = reader.readSaveBodyHash();\n\n\t\t// parse grids\n\t\tsave.grids = reader.readGrids();\n\n\t\t// parse levels\n\t\tsave.levels = reader.readLevels();\n\n\t\treturn save;\n\t}\n\n\t/**\n\t * serializes a {@link SatisfactorySave} into binary and reports back on individual callbacks.\n\t * @param save the {@link SatisfactorySave} to serialize into binary.\n\t * @param options provides callbacks. onBinaryBeforeCompressing gets called on the binary save body before it is compressed.\n\t * onHeader gets called on the binary save header, which is always uncompressed.\n\t * onChunk gets called when a chunk of the compressed save body was generated. Often, files' save bodies consist of multiple chunks.\n\t * @returns a summary of the generated chunks.\n\t */\n\tpublic static WriteSave(save: SatisfactorySave,\n\t\tonHeader: (header: Uint8Array) => void,\n\t\tonChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonBinaryBeforeCompressing: (buffer: ArrayBuffer) => void,\n\t\t}>\n\t): ChunkSummary[] {\n\n\t\tconst writer = new SaveWriter();\n\n\t\tSaveWriter.WriteHeader(writer, save.header);\n\t\tconst posAfterHeader = writer.getBufferPosition();\n\n\t\tSaveWriter.WriteSaveBodyHash(writer, save.gridHash);\n\t\tSaveWriter.WriteGrids(writer, save.grids);\n\t\tSaveWriter.WriteLevels(writer, save, save.header.buildVersion);\n\n\t\twriter.endWriting();\n\t\tconst chunkSummary = writer.generateChunks(save.compressionInfo!, posAfterHeader, options?.onBinaryBeforeCompressing ?? (() => { }), onHeader, onChunk);\n\t\treturn chunkSummary;\n\t}\n\n\t/**\n\t * Writes a {@link Blueprint} object to binary. And reports back on individual callbacks.\n\t * @param blueprint the blueprint to be written\n\t * @param options onMainFileBinaryBeforeCompressing gets called back when the main blueprint file binary is ready before compressing.\n\t * onMainFileHeader gets called back when the main blueprint file header is ready. onMainFileChunk gets called back when a main blueprint file chunk is ready.\n\t * @returns a chunk summary of the main file generated chunks. Plus the binary data of the config file, since it is often very small.\n\t */\n\tpublic static WriteBlueprintFiles(\n\t\tblueprint: Blueprint,\n\t\tonMainFileHeader: (header: Uint8Array) => void,\n\t\tonMainFileChunk: (chunk: Uint8Array) => void,\n\t\toptions?: Partial<{\n\t\t\tonMainFileBinaryBeforeCompressing: (binary: ArrayBuffer) => void,\n\t\t}>\n\t): {\n\t\tmainFileChunkSummary: ChunkSummary[],\n\t\tconfigFileBinary: ArrayBuffer\n\t} {\n\n\t\t// write main blueprint file\n\t\tconst blueprintWriter = new BlueprintWriter();\n\t\tBlueprintWriter.SerializeHeader(blueprintWriter, blueprint.header);\n\t\tconst saveBodyPos = blueprintWriter.getBufferPosition();\n\t\tBlueprintWriter.SerializeObjects(blueprintWriter, blueprint.objects);\n\t\tblueprintWriter.endWriting();\n\t\tlet binaryChunks: Uint8Array[] = [];\n\t\tlet binaryHeader: Uint8Array;\n\t\tconst mainFileChunkSummary = blueprintWriter.generateChunks(\n\t\t\tblueprint.compressionInfo,\n\t\t\tsaveBodyPos,\n\t\t\t{\n\t\t\t\tonBinaryBeforeCompressing: options?.onMainFileBinaryBeforeCompressing ?? (() => { }),\n\t\t\t\tonHeader: onMainFileHeader,\n\t\t\t\tonChunk: onMainFileChunk\n\t\t\t}\n\t\t);\n\n\t\t// write config as well.\n\t\tconst configWriter = new BlueprintConfigWriter();\n\t\tBlueprintConfigWriter.SerializeConfig(configWriter, blueprint.config);\n\t\tconst configFileBinary = configWriter.endWriting();\n\n\t\treturn {\n\t\t\tmainFileChunkSummary,\n\t\t\tconfigFileBinary\n\t\t}\n\t}\n\n\t/**\n\t * Parses two buffers (main blueprint file + config file) into a {@link Blueprint object}\n\t * @param name the name of the blueprint, since it is not part of the binary data and has to be passed.\n\t * @param blueprintFile the main blueprint file \".sbp\"\n\t * @param blueprintConfigFile the config blueprint file \".sbpcfg\"\n\t * @param options provides callbacks. onDecompressedBlueprintBody gets called when the body of the main blueprint file is decompressed.\n\t * @returns \n\t */\n\tpublic static ParseBlueprintFiles(\n\t\tname: string,\n\t\tblueprintFile: Buffer,\n\t\tblueprintConfigFile: Buffer,\n\t\toptions?: Partial<{\n\t\t\tonDecompressedBlueprintBody: (buffer: ArrayBuffer) => void\n\t\t}>\n\t): Blueprint {\n\n\t\t// read config file\n\t\tconst blueprintConfigReader = new BlueprintConfigReader(new Uint8Array(blueprintConfigFile).buffer);\n\t\tconst config = BlueprintConfigReader.ParseConfig(blueprintConfigReader);\n\n\t\t// read actual blueprint file\n\t\tconst blueprintReader = new BlueprintReader(new Uint8Array(blueprintFile).buffer);\n\t\tconst header = BlueprintReader.ReadHeader(blueprintReader);\n\t\tconst inflateResult = blueprintReader.inflateChunks();\n\n\t\t// call back on decompressed body.\n\t\tif (options?.onDecompressedBlueprintBody !== undefined) {\n\t\t\toptions.onDecompressedBlueprintBody(inflateResult.inflatedData);\n\t\t}\n\n\t\tconst blueprintObjects = BlueprintReader.ParseObjects(blueprintReader);\n\t\tconst blueprint: Blueprint = {\n\t\t\tname,\n\t\t\tcompressionInfo: blueprintReader.compressionInfo,\n\t\t\theader: header,\n\t\t\tconfig,\n\t\t\tobjects: blueprintObjects\n\t\t};\n\t\treturn blueprint;\n\t}\n\n\t/**\n\t * It JSON.stringifies any parsed content safely. The original JSON.stringify() has some flaws that get in the way, so it is custom wrapped. The original has some problems:\n\t * 1. it cannot stringify bigints. So we help out by converting it into a string.\n\t * 2. It cannot distinguish between 0 and -0. But a float32 is encoded in a uint8Array for 0 to be [0,0,0,0] (0x00000000) and -0 to be [0,0,0,128] (0x00000080) in little endian.\n\t * @param obj basically anything that can be stringified\n\t * @param indent the indentation, just like with the real JSON stringify.\n\t * @returns a string that is safely stringified.\n\t */\n\tpublic static JSONStringifyModified = (obj: any, indent: number = 0): string =>\n\t\tJSON.stringify(obj, (key, value) => {\n\t\t\tif (typeof value === 'bigint') {\n\t\t\t\treturn value.toString();\n\t\t\t} else if (value === 0 && 1 / value < 0) {\t// -0\n\t\t\t\treturn '-0';\n\t\t\t}\n\t\t\treturn value;\n\t\t}, indent)\n\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"level.class.d.ts","sourceRoot":"","sources":["../../../../src/parser/satisfactory/save/level.class.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAm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AU,EAAE,KAAG,IAUxF,CAAA;IAEM,MAAM,kBAAkB,WAAY,cAAc,SAAS,MAAM,KAAG,CAAC,UAAU,GAAG,aAAa,CAAC,EAsBtG,CAAA;IAEM,MAAM,yBAAyB,WAAY,UAAU,WAAW,CAAC,UAAU,GAAG,aAAa,CAAC,EAAE,KAAG,IAkBvG,CAAA;CACD"}
@@ -43,7 +43,9 @@ var Level;
43
43
  writer.writeInt32(0);
44
44
  writer.writeInt32(0);
45
45
  Level.SerializeAllObjectHeaders(writer, level.objects);
46
- object_references_list_1.ObjectReferencesList.SerializeList(writer, level.collectables);
46
+ if (level.collectables.length > 0) {
47
+ object_references_list_1.ObjectReferencesList.SerializeList(writer, level.collectables);
48
+ }
47
49
  writer.writeBinarySizeFromPosition(lenIndicatorHeaderAndDestroyedEntitiesSize, lenIndicatorHeaderAndDestroyedEntitiesSize + 8);
48
50
  Level.SerializeAllObjectContents(writer, level.objects, buildVersion, level.name);
49
51
  object_references_list_1.ObjectReferencesList.SerializeList(writer, level.collectables);