@divinevoxel/vlox 0.0.72 → 0.0.74

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 (307) hide show
  1. package/Contexts/Base/Remote/InitDataSync.js +4 -0
  2. package/Contexts/Base/Remote/InitWorldDataSync.js +1 -1
  3. package/Contexts/Render/DivineVoxelEngineRender.d.ts +2 -1
  4. package/Contexts/World/DivineVoxelEngineWorld.d.ts +2 -1
  5. package/Init/StartConstructor.js +8 -4
  6. package/Init/StartWorld.d.ts +1 -1
  7. package/Math/index.d.ts +5 -1
  8. package/Mesher/Functions/CompactVoxelMesh.d.ts +2 -2
  9. package/Mesher/Functions/CompactVoxelMesh.js +1 -1
  10. package/Mesher/Functions/CompactVoxelSectionMesh.d.ts +4 -0
  11. package/Mesher/Functions/CompactVoxelSectionMesh.js +112 -0
  12. package/Mesher/Functions/MeshSection.d.ts +1 -1
  13. package/Mesher/Functions/MeshSection.js +27 -22
  14. package/Mesher/Functions/MeshTexture.d.ts +1 -1
  15. package/Mesher/Functions/MeshTexture.js +3 -4
  16. package/Mesher/Geomtry/CompactedSectionVoxelMesh.d.ts +23 -0
  17. package/Mesher/Geomtry/CompactedSectionVoxelMesh.js +144 -0
  18. package/Mesher/Geomtry/Primitives/QuadVertexData.d.ts +12 -10
  19. package/Mesher/Geomtry/Primitives/QuadVertexData.js +49 -56
  20. package/Mesher/Geomtry/VoxelGeometryBuilder.d.ts +2 -2
  21. package/Mesher/Geomtry/VoxelGeometryBuilder.js +120 -199
  22. package/Mesher/Geomtry/VoxelMesh.d.ts +1 -1
  23. package/Mesher/Geomtry/VoxelMesh.js +4 -4
  24. package/Mesher/Geomtry/VoxelMeshBVHBuilder.d.ts +16 -0
  25. package/Mesher/Geomtry/VoxelMeshBVHBuilder.js +51 -0
  26. package/Mesher/Geomtry/VoxelMeshBVHStructCursor.d.ts +22 -0
  27. package/Mesher/Geomtry/VoxelMeshBVHStructCursor.js +78 -0
  28. package/Mesher/Geomtry/{Buffers.js → VoxelMeshBuffers.js} +2 -2
  29. package/Mesher/Geomtry/index.d.ts +0 -1
  30. package/Mesher/Geomtry/index.js +0 -1
  31. package/Mesher/InitMesher.js +1 -1
  32. package/Mesher/InitTask.js +9 -23
  33. package/Mesher/Models/Common/BoxGeometryNode.js +7 -7
  34. package/Mesher/Models/Common/Calc/CalcConstants.d.ts +1 -1
  35. package/Mesher/Models/Common/Calc/CalcConstants.js +1 -1
  36. package/Mesher/Models/Common/Calc/FaceDataCalc.d.ts +2 -2
  37. package/Mesher/Models/Common/Calc/FaceDataCalc.js +37 -30
  38. package/Mesher/Models/Common/QuadGeometryNode.js +2 -2
  39. package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.d.ts +2 -2
  40. package/Mesher/Models/Nodes/Custom/Liquid/FlowGradient.js +1 -1
  41. package/Mesher/Models/Nodes/Custom/Liquid/LiquidGeomtryNode.js +18 -24
  42. package/Mesher/Models/Nodes/GeometryNode.d.ts +2 -2
  43. package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.d.ts +1 -0
  44. package/Mesher/Models/Nodes/Ruled/BoxVoxelGeometryNode.js +40 -31
  45. package/Mesher/Models/Nodes/Ruled/QuadVoxelGeometryNode.js +2 -2
  46. package/Mesher/Models/Nodes/Ruleless/RulelessBoxVoxelGeometryNode.js +2 -2
  47. package/Mesher/Models/Nodes/Ruleless/RulelessQuadVoxelGeometryNode.js +2 -2
  48. package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.d.ts +1 -1
  49. package/Mesher/{Tools → Models/Protocols}/OutlinedVoxelTool.js +1 -1
  50. package/Mesher/Models/RenderedMaterials.d.ts +6 -0
  51. package/Mesher/{RenderedMaterials.js → Models/RenderedMaterials.js} +2 -2
  52. package/Mesher/Models/VoxelConstructor.d.ts +6 -6
  53. package/Mesher/Models/VoxelConstructor.js +8 -8
  54. package/Mesher/Models/VoxelGeometryBuilderCacheSpace.d.ts +3 -5
  55. package/Mesher/Models/VoxelGeometryBuilderCacheSpace.js +8 -32
  56. package/Mesher/{Tools/VoxelMesherDataTool.d.ts → Models/VoxelModelBuilder.d.ts} +4 -5
  57. package/Mesher/{Tools/VoxelMesherDataTool.js → Models/VoxelModelBuilder.js} +5 -8
  58. package/Mesher/Types/Mesher.types.d.ts +1 -0
  59. package/Models/Defaults/CubeVoxelGeometry.js +4 -0
  60. package/Models/Defaults/CubeVoxelModels.js +360 -383
  61. package/Models/Defaults/LiquidVoxelModel.js +5 -5
  62. package/Models/Defaults/PanelVoxelModels.js +442 -468
  63. package/Models/Defaults/StairVoxelModel.js +582 -597
  64. package/Models/Examples.js +490 -498
  65. package/Models/Rules/Classes/VoxelRulesModel.d.ts +1 -1
  66. package/Models/Rules/Classes/VoxelRulesModel.js +3 -3
  67. package/Models/Rules/Functions/BuildFinalInputs.d.ts +1 -1
  68. package/Models/Rules/Functions/BuildFinalInputs.js +21 -19
  69. package/Models/Rules/Functions/BuildGeomtryInputs.js +8 -5
  70. package/Models/Rules/Functions/BuildRules.js +2 -2
  71. package/Models/Rules/{VoxelModelManager.d.ts → VoxelModelRuleBuilderRegister.d.ts} +1 -1
  72. package/Models/Rules/VoxelModelRuleBuilderRegister.js +178 -0
  73. package/Models/VoxelModel.types.d.ts +17 -8
  74. package/Renderer/Classes/DVESectionMeshes.d.ts +2 -3
  75. package/Renderer/Classes/SectorMesh.d.ts +3 -4
  76. package/Renderer/Classes/SectorMesh.js +6 -11
  77. package/Renderer/InitTasks.js +1 -10
  78. package/Renderer/MeshManager.d.ts +1 -1
  79. package/Renderer/MeshManager.js +26 -25
  80. package/Renderer/MeshRegister.d.ts +5 -5
  81. package/Renderer/MeshRegister.js +4 -3
  82. package/Settings/EngineSettings.d.ts +2 -1
  83. package/Settings/EngineSettings.js +6 -5
  84. package/Settings/EngineSettings.types.d.ts +24 -39
  85. package/Settings/EngineSettings.types.js +22 -29
  86. package/Tasks/Logic/InitTasks.d.ts +1 -0
  87. package/Tasks/Logic/InitTasks.js +10 -0
  88. package/Tasks/Logic/VoxelLogicUpdate.d.ts +3 -0
  89. package/Tasks/Logic/VoxelLogicUpdate.js +71 -0
  90. package/Tasks/Propagation/Explosion/ExplosionManager.d.ts +2 -2
  91. package/Tasks/Propagation/Explosion/ExplosionManager.js +1 -2
  92. package/Tasks/Propagation/Flow/FlowManager.d.ts +4 -4
  93. package/Tasks/Propagation/Flow/FlowRemove.d.ts +2 -2
  94. package/Tasks/Propagation/Flow/FlowUpdate.d.ts +2 -2
  95. package/Tasks/Propagation/Flow/WorldFlow.d.ts +2 -2
  96. package/Tasks/Propagation/Illumanation/RGBUpdate.d.ts +3 -3
  97. package/Tasks/Propagation/Illumanation/SunUpdate.d.ts +3 -3
  98. package/Tasks/Propagation/Illumanation/WorldRGB.d.ts +2 -2
  99. package/Tasks/Propagation/Illumanation/WorldSun.d.ts +2 -2
  100. package/Tasks/Propagation/Illumanation/WorldSun.js +8 -15
  101. package/Tasks/Propagation/InitTasks.js +4 -4
  102. package/Tasks/Propagation/Power/PowerUpdate.d.ts +3 -0
  103. package/Tasks/Propagation/Power/PowerUpdate.js +80 -0
  104. package/Tasks/Tasks.types.d.ts +2 -2
  105. package/Tasks/TasksIds.d.ts +2 -1
  106. package/Tasks/TasksIds.js +1 -0
  107. package/Tasks/Update/Common.d.ts +3 -0
  108. package/Tasks/Update/Common.js +41 -0
  109. package/Tasks/Update/EreaseUpdate.d.ts +3 -0
  110. package/Tasks/Update/EreaseUpdate.js +66 -0
  111. package/Tasks/Update/InitTasks.d.ts +2 -2
  112. package/Tasks/Update/InitTasks.js +3 -1
  113. package/Tasks/Update/PaintUpdate.d.ts +3 -0
  114. package/Tasks/Update/PaintUpdate.js +89 -0
  115. package/Tasks/Update/VoxelUpdate.d.ts +2 -5
  116. package/Tasks/Update/VoxelUpdate.js +7 -143
  117. package/Tasks/{Update/UpdateTask.d.ts → VoxelUpdateTask.d.ts} +16 -6
  118. package/Tasks/{Update/UpdateTask.js → VoxelUpdateTask.js} +44 -5
  119. package/Tasks/WorldGeneration/WorldGenBrush.d.ts +3 -3
  120. package/Tasks/WorldGeneration/WorldGenBrush.js +3 -3
  121. package/Tasks/WorldGeneration/WorldGenRegister.d.ts +1 -1
  122. package/Templates/Cursor/TemplateCursor.d.ts +2 -2
  123. package/Templates/Cursor/TemplateCursor.js +1 -2
  124. package/Templates/Functions/CreateTemplate.d.ts +1 -1
  125. package/Templates/VoxelTemplates.types.d.ts +1 -1
  126. package/Textures/Classes/CompiledTexture.d.ts +18 -0
  127. package/Textures/Classes/CompiledTexture.js +50 -0
  128. package/Textures/Classes/CompiledTextureAnimation.d.ts +12 -0
  129. package/Textures/Classes/CompiledTextureAnimation.js +27 -0
  130. package/Textures/Classes/TextureAnimationTexture.d.ts +10 -0
  131. package/Textures/Classes/TextureAnimationTexture.js +32 -0
  132. package/Textures/Functions/BuildTextureData.d.ts +10 -0
  133. package/Textures/Functions/BuildTextureData.js +205 -0
  134. package/Textures/Texture.types.d.ts +50 -64
  135. package/Textures/TextureManager.d.ts +8 -19
  136. package/Textures/TextureManager.js +28 -166
  137. package/Tools/Brush/AdvancedBrushTool.js +1 -1
  138. package/Tools/Brush/Brush.d.ts +3 -3
  139. package/Tools/Brush/Brush.js +40 -8
  140. package/Tools/Tasks/TasksTool.d.ts +1 -0
  141. package/Tools/Tasks/TasksTool.js +2 -0
  142. package/Util/Binary/BinaryArrays.d.ts +6 -0
  143. package/Util/Binary/BinaryArrays.js +25 -0
  144. package/Util/Binary/BinaryBuffer.d.ts +35 -0
  145. package/Util/Binary/BinaryBuffer.js +136 -0
  146. package/Util/Binary/{BitArray.d.ts → BinaryFunctions.d.ts} +1 -2
  147. package/Util/Binary/BinaryFunctions.js +11 -0
  148. package/{Mesher/Tools/VoxelMeshBVHBuilder.d.ts → Util/Binary/BinaryTree.d.ts} +1 -33
  149. package/Util/Binary/BinaryTree.js +104 -0
  150. package/Voxels/Cursor/DataCursor.interface.d.ts +5 -0
  151. package/Voxels/Cursor/VoxelCursor.interface.d.ts +8 -3
  152. package/Voxels/Cursor/VoxelCursor.interface.js +54 -13
  153. package/Voxels/Cursor/VoxelLightData.js +1 -1
  154. package/Voxels/Data/VoxelPalettesRegister.d.ts +0 -5
  155. package/Voxels/Data/VoxelPalettesRegister.js +0 -9
  156. package/Voxels/Data/VoxelTag.types.d.ts +17 -2
  157. package/Voxels/Data/VoxelTag.types.js +6 -1
  158. package/Voxels/Data/VoxelTagsRegister.js +12 -7
  159. package/Voxels/Functions/BuildStateData.d.ts +6 -6
  160. package/Voxels/Functions/BuildStateData.js +37 -37
  161. package/Voxels/Functions/BuildTagAndPaletteData.js +6 -3
  162. package/Voxels/Indexes/VoxelIndex.d.ts +2 -2
  163. package/Voxels/Indexes/VoxelIndex.js +16 -18
  164. package/Voxels/InitVoxelData.js +24 -21
  165. package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.d.ts +5 -0
  166. package/Voxels/Logic/Classes/Default/Types/VoxelPoweredLogicType.js +6 -0
  167. package/Voxels/Logic/Classes/VoxelLogic.d.ts +11 -0
  168. package/Voxels/Logic/Classes/VoxelLogic.js +49 -0
  169. package/Voxels/Logic/Classes/VoxelLogicType.d.ts +4 -0
  170. package/Voxels/Logic/Classes/VoxelLogicType.js +2 -0
  171. package/Voxels/Logic/VoxelLogic.types.d.ts +23 -0
  172. package/Voxels/Logic/VoxelLogic.types.js +1 -0
  173. package/Voxels/Logic/VoxelLogicRegister.d.ts +9 -0
  174. package/Voxels/Logic/VoxelLogicRegister.js +15 -0
  175. package/Voxels/State/Schema/StateSchema.d.ts +1 -1
  176. package/Voxels/State/SchemaRegister.js +10 -5
  177. package/Voxels/State/State.types.d.ts +1 -1
  178. package/Voxels/State/StateTreeReader.d.ts +1 -1
  179. package/Voxels/State/StateTreeReader.js +2 -3
  180. package/Voxels/Types/Voxel.types.d.ts +21 -0
  181. package/Voxels/Types/Voxel.types.js +6 -2
  182. package/Voxels/Types/VoxelModelCompiledData.types.d.ts +6 -4
  183. package/World/Archive/Archive.types.d.ts +65 -42
  184. package/World/Archive/Classes/ArchiveClasses.d.ts +66 -0
  185. package/World/Archive/Classes/ArchiveClasses.js +78 -0
  186. package/World/Archive/Classes/ImportedSection.d.ts +40 -0
  187. package/World/Archive/Classes/ImportedSection.js +307 -0
  188. package/World/Archive/Classes/ImportedSector.d.ts +23 -0
  189. package/World/Archive/Classes/ImportedSector.js +97 -0
  190. package/World/Archive/Functions/ArchiveArea.d.ts +1 -1
  191. package/World/Archive/Functions/ArchiveArea.js +49 -54
  192. package/World/Archive/Functions/ArchiveSector.js +373 -282
  193. package/World/Archive/Functions/CreateArchivedSection.d.ts +3 -0
  194. package/World/Archive/Functions/CreateArchivedSection.js +207 -0
  195. package/World/Archive/Functions/ImportSector.d.ts +2 -4
  196. package/World/Archive/Functions/ImportSector.js +50 -220
  197. package/World/Archive/Functions/RemoveDuplicates.d.ts +3 -0
  198. package/World/Archive/Functions/RemoveDuplicates.js +92 -0
  199. package/World/Archive/Functions/Shared.d.ts +6 -0
  200. package/World/Archive/Functions/Shared.js +50 -0
  201. package/World/Archive/InitTasks.js +37 -23
  202. package/World/Cursor/SectionCursor.d.ts +3 -3
  203. package/World/Cursor/SectionCursor.js +2 -3
  204. package/World/Cursor/SectorCursor.d.ts +3 -3
  205. package/World/Cursor/SectorCursor.js +1 -2
  206. package/World/Cursor/WorldCursor.d.ts +6 -5
  207. package/World/Cursor/WorldCursor.js +17 -15
  208. package/World/Cursor/WorldVoxelCursor.d.ts +0 -4
  209. package/World/Cursor/WorldVoxelCursor.js +24 -14
  210. package/World/Dimension/Dimension.d.ts +4 -1
  211. package/World/Dimension/Dimension.js +8 -1
  212. package/World/InitTasks.d.ts +1 -1
  213. package/World/Lock/WorldLock.d.ts +1 -1
  214. package/World/Section/Section.d.ts +27 -18
  215. package/World/Section/Section.js +125 -21
  216. package/World/Section/SectionState.d.ts +12 -0
  217. package/World/Section/SectionState.js +13 -0
  218. package/World/Sector/Sector.d.ts +20 -6
  219. package/World/Sector/Sector.js +100 -17
  220. package/World/Sector/SectorHeightMap.js +2 -2
  221. package/World/Sector/SectorState.d.ts +16 -7
  222. package/World/Sector/SectorState.js +29 -15
  223. package/World/Types/WorldData.types.d.ts +2 -7
  224. package/World/Types/WorldStorage.interface.js +1 -0
  225. package/World/WorldRegister.d.ts +13 -9
  226. package/World/WorldRegister.js +24 -9
  227. package/World/WorldSpaces.d.ts +4 -0
  228. package/World/WorldSpaces.js +25 -12
  229. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.d.ts +2 -2
  230. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.d.ts +10 -3
  231. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/Generator.js +19 -3
  232. package/WorldSimulation/Internal/Classes/Queues/BuildQueue.d.ts +5 -0
  233. package/WorldSimulation/Internal/Classes/Queues/BuildQueue.js +6 -0
  234. package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.d.ts +5 -0
  235. package/WorldSimulation/Internal/Classes/Queues/LogiccQueue.js +6 -0
  236. package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.js +1 -1
  237. package/WorldSimulation/Internal/Classes/TickQueue.d.ts +12 -0
  238. package/WorldSimulation/Internal/Classes/TickQueue.js +58 -0
  239. package/WorldSimulation/Internal/Classes/WorldSimulationTaskBase.d.ts +15 -0
  240. package/{Tasks/IWG/Internal/Classes/IWGTaskBase.js → WorldSimulation/Internal/Classes/WorldSimulationTaskBase.js} +8 -8
  241. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.js +9 -9
  242. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.d.ts +1 -1
  243. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/getSectorState.js +4 -4
  244. package/WorldSimulation/Internal/Functions/runTickUpdate.d.ts +2 -0
  245. package/{Tasks/IWG/Internal/Functions/runBuildUpdate.js → WorldSimulation/Internal/Functions/runTickUpdate.js} +38 -9
  246. package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.js +13 -13
  247. package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.d.ts +2 -2
  248. package/{Tasks/IWG → WorldSimulation}/Internal/TaskRegister.js +1 -1
  249. package/WorldSimulation/Internal/WorldSimulationDimensions.d.ts +6 -0
  250. package/{Tasks/IWG/Internal/IWGDimensions.js → WorldSimulation/Internal/WorldSimulationDimensions.js} +1 -1
  251. package/WorldSimulation/Internal/WorldSimulationTasks.d.ts +30 -0
  252. package/{Tasks/IWG/Internal/IWGTasks.js → WorldSimulation/Internal/WorldSimulationTasks.js} +14 -24
  253. package/WorldSimulation/Internal/WorldSimulationTools.d.ts +8 -0
  254. package/{Tasks/IWG/Internal/IWGTools.js → WorldSimulation/Internal/WorldSimulationTools.js} +1 -1
  255. package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.d.ts +1 -1
  256. package/{Tasks/IWG → WorldSimulation}/Procedures/InitalLoad.js +11 -11
  257. package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.js +7 -5
  258. package/{Tasks/IWG/IWG.d.ts → WorldSimulation/WorldSimulation.d.ts} +6 -5
  259. package/{Tasks/IWG/IWG.js → WorldSimulation/WorldSimulation.js} +29 -23
  260. package/{Tasks/IWG → WorldSimulation}/index.d.ts +1 -1
  261. package/{Tasks/IWG → WorldSimulation}/index.js +1 -1
  262. package/package.json +1 -1
  263. package/Mesher/Functions/CompactMesh.d.ts +0 -2
  264. package/Mesher/Functions/CompactMesh.js +0 -42
  265. package/Mesher/Geomtry/GeometryNormals.d.ts +0 -10
  266. package/Mesher/Geomtry/GeometryNormals.js +0 -52
  267. package/Mesher/Geomtry/MeshData.types.d.ts +0 -13
  268. package/Mesher/Geomtry/MeshData.types.js +0 -6
  269. package/Mesher/Geomtry/Tools/MesherDataTools.d.ts +0 -7
  270. package/Mesher/Geomtry/Tools/MesherDataTools.js +0 -12
  271. package/Mesher/Geomtry/Tools/index.d.ts +0 -1
  272. package/Mesher/Geomtry/Tools/index.js +0 -1
  273. package/Mesher/RenderedMaterials.d.ts +0 -6
  274. package/Mesher/Tools/VoxelMeshBVHBuilder.js +0 -216
  275. package/Models/Rules/VoxelModelManager.js +0 -82
  276. package/Tasks/IWG/Internal/Classes/IWGTaskBase.d.ts +0 -15
  277. package/Tasks/IWG/Internal/Functions/runBuildUpdate.d.ts +0 -2
  278. package/Tasks/IWG/Internal/IWGDimensions.d.ts +0 -6
  279. package/Tasks/IWG/Internal/IWGTasks.d.ts +0 -34
  280. package/Tasks/IWG/Internal/IWGTools.d.ts +0 -8
  281. package/Textures/TextureAnimations.d.ts +0 -4
  282. package/Textures/TextureAnimations.js +0 -35
  283. package/Textures/TextureArray.d.ts +0 -47
  284. package/Textures/TextureArray.js +0 -202
  285. package/Textures/TextureBuilder.d.ts +0 -13
  286. package/Textures/TextureBuilder.js +0 -120
  287. package/Textures/TextureRegister.d.ts +0 -9
  288. package/Textures/TextureRegister.js +0 -28
  289. package/Tools/DataCursor.interface.d.ts +0 -5
  290. package/Tools/DataCursor.interface.js +0 -2
  291. package/Util/Binary/BitArray.js +0 -16
  292. package/World/Structs/WorldDataStructProperties.d.ts +0 -8
  293. package/World/Structs/WorldDataStructProperties.js +0 -9
  294. /package/Mesher/Geomtry/{Buffers.d.ts → VoxelMeshBuffers.d.ts} +0 -0
  295. /package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.d.ts +0 -0
  296. /package/Mesher/{Tools → Geomtry}/VoxelMeshVertexStructCursor.js +0 -0
  297. /package/Mesher/{VoxelShaderData.d.ts → Geomtry/VoxelShaderData.d.ts} +0 -0
  298. /package/Mesher/{VoxelShaderData.js → Geomtry/VoxelShaderData.js} +0 -0
  299. /package/{World/Storage/WorldStorage.interface.js → Voxels/Cursor/DataCursor.interface.js} +0 -0
  300. /package/World/{Storage → Types}/WorldStorage.interface.d.ts +0 -0
  301. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/DimensionSegment.js +0 -0
  302. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.d.ts +0 -0
  303. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorState.js +0 -0
  304. /package/{Tasks/IWG → WorldSimulation}/Internal/Classes/SectorVisistedMap.d.ts +0 -0
  305. /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/cullSectors.d.ts +0 -0
  306. /package/{Tasks/IWG → WorldSimulation}/Internal/Functions/runWorldUpdate.d.ts +0 -0
  307. /package/{Tasks/IWG → WorldSimulation}/Procedures/SaveAllSectors.d.ts +0 -0
@@ -1,9 +1,12 @@
1
1
  import { Vector3Like } from "@amodx/math";
2
2
  import { Circle } from "@amodx/math/Shapes";
3
- import { WorldSpaces } from "../../../../World/WorldSpaces";
3
+ import { WorldSpaces } from "../../../World/WorldSpaces";
4
+ import { BuildQueue } from "./Queues/BuildQueue";
5
+ import { LogicQueue } from "./Queues/LogiccQueue";
4
6
  export class Generator {
7
+ taskTool;
5
8
  position;
6
- _dimension = "main";
9
+ _dimension = 0;
7
10
  _building = true;
8
11
  _positonChanged = false;
9
12
  _waitingForCull = false;
@@ -14,7 +17,10 @@ export class Generator {
14
17
  _genCircle = new Circle({ x: 0, y: 0 }, 0);
15
18
  _renderCircle = new Circle({ x: 0, y: 0 }, 0);
16
19
  _maxCircle = new Circle({ x: 0, y: 0 }, 10);
17
- constructor(data) {
20
+ buildQueue;
21
+ logicQueue;
22
+ constructor(taskTool, data) {
23
+ this.taskTool = taskTool;
18
24
  this._dimension = data.dimension;
19
25
  this.position = data.position;
20
26
  this._building =
@@ -23,6 +29,8 @@ export class Generator {
23
29
  this._renderCircle.radius = data.renderRadius;
24
30
  this._genCircle.radius = data.generationRadius;
25
31
  this._maxCircle.radius = data.maxRadius;
32
+ this.buildQueue = new BuildQueue(taskTool);
33
+ this.logicQueue = new LogicQueue(taskTool);
26
34
  }
27
35
  update() {
28
36
  this._positonChanged = false;
@@ -38,4 +46,12 @@ export class Generator {
38
46
  this._maxCircle.center.x = this._sectorPosition.x;
39
47
  this._maxCircle.center.y = this._sectorPosition.z;
40
48
  }
49
+ tick() {
50
+ if (this._building) {
51
+ this.buildQueue.sort(this.position.x, this.position.y, this.position.z);
52
+ this.buildQueue.run(125);
53
+ }
54
+ this.logicQueue.sort(this.position.x, this.position.y, this.position.z);
55
+ this.logicQueue.run();
56
+ }
41
57
  }
@@ -0,0 +1,5 @@
1
+ import { LocationData } from "Math";
2
+ import { TickQueue } from "../TickQueue";
3
+ export declare class BuildQueue extends TickQueue {
4
+ runTask(section: LocationData): void;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { TickQueue } from "../TickQueue";
2
+ export class BuildQueue extends TickQueue {
3
+ runTask(section) {
4
+ this.tasks.build.section.run(section);
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ import { LocationData } from "Math";
2
+ import { TickQueue } from "../TickQueue";
3
+ export declare class LogicQueue extends TickQueue {
4
+ runTask(section: LocationData): void;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { TickQueue } from "../TickQueue";
2
+ export class LogicQueue extends TickQueue {
3
+ runTask(section) {
4
+ this.tasks.voxel.logic.run(section);
5
+ }
6
+ }
@@ -1,5 +1,5 @@
1
1
  import { Vector3Like } from "@amodx/math";
2
- import { WorldSpaces } from "../../../../World/WorldSpaces";
2
+ import { WorldSpaces } from "../../../World/WorldSpaces";
3
3
  const tempPosition = Vector3Like.Create();
4
4
  export class SectorVisistedMap {
5
5
  _map = new Set();
@@ -0,0 +1,12 @@
1
+ import { LocationData } from "../../../Math";
2
+ import { TaskTool } from "../../../Tools/Tasks/TasksTool";
3
+ export declare abstract class TickQueue {
4
+ tasks: TaskTool;
5
+ hash: Set<unknown>;
6
+ sections: LocationData[];
7
+ constructor(tasks: TaskTool);
8
+ add(dimension: number, x: number, y: number, z: number): false | undefined;
9
+ sort(x: number, y: number, z: number): LocationData[];
10
+ abstract runTask(section: LocationData): void;
11
+ run(limit?: number): void;
12
+ }
@@ -0,0 +1,58 @@
1
+ import { WorldSpaces } from "../../../World/WorldSpaces";
2
+ const pool = [];
3
+ export class TickQueue {
4
+ tasks;
5
+ hash = new Set();
6
+ sections = [];
7
+ constructor(tasks) {
8
+ this.tasks = tasks;
9
+ }
10
+ add(dimension, x, y, z) {
11
+ const key = WorldSpaces.hash.hashXYZ(x, y, z);
12
+ if (this.hash.has(key))
13
+ return false;
14
+ this.hash.add(key);
15
+ const location = pool.length ? pool.shift() : [0, 0, 0, 0];
16
+ location[0] = dimension;
17
+ location[1] = x;
18
+ location[2] = y;
19
+ location[3] = z;
20
+ this.sections.push(location);
21
+ }
22
+ sort(x, y, z) {
23
+ const sections = this.sections;
24
+ const sx = x, sy = y, sz = z;
25
+ let i = sections.length, j, temp, ax, ay, az, bx, by, bz, distA, distB;
26
+ while (i > 1) {
27
+ for (j = 1; j < i; j++) {
28
+ (ax = sections[j - 1][1]),
29
+ (ay = sections[j - 1][2]),
30
+ (az = sections[j - 1][3]);
31
+ (bx = sections[j][1]), (by = sections[j][2]), (bz = sections[j][3]);
32
+ distA = (ax - sx) ** 2 + (ay - sy) ** 2 + (az - sz) ** 2;
33
+ distB = (bx - sx) ** 2 + (by - sy) ** 2 + (bz - sz) ** 2;
34
+ if (distA > distB) {
35
+ temp = sections[j - 1];
36
+ sections[j - 1] = sections[j];
37
+ sections[j] = temp;
38
+ }
39
+ }
40
+ i--;
41
+ }
42
+ return sections;
43
+ }
44
+ run(limit = 25) {
45
+ let count = 0;
46
+ while (this.sections.length) {
47
+ const vec = this.sections.shift();
48
+ const [, x, y, z] = vec;
49
+ this.runTask(vec);
50
+ this.tasks.build.section.run(vec);
51
+ this.hash.delete(WorldSpaces.hash.hashXYZ(x, y, z));
52
+ count++;
53
+ pool.push(vec);
54
+ if (count > limit)
55
+ break;
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,15 @@
1
+ import { LocationData } from "../../../Math/index.js";
2
+ import { DimensionSegment } from "./DimensionSegment.js";
3
+ export type WorldSimulationTaskBase = {
4
+ id: string;
5
+ propagationBlocking?: boolean;
6
+ run(location: LocationData, onDone: () => void, dimension: DimensionSegment): void;
7
+ };
8
+ export declare class IWGTaskBase {
9
+ data: WorldSimulationTaskBase;
10
+ constructor(data: WorldSimulationTaskBase);
11
+ add(dimensionId: number, x: number, y: number, z: number): void;
12
+ remove(dimensionId: number, x: number, y: number, z: number): void;
13
+ cancelAll(dimensionId?: number | null): void;
14
+ runTask(max?: number): void;
15
+ }
@@ -1,11 +1,11 @@
1
- import { IWGDimensions } from "../../Internal/IWGDimensions.js";
1
+ import { WorldSimulationDimensions } from "../WorldSimulationDimensions.js";
2
2
  export class IWGTaskBase {
3
3
  data;
4
4
  constructor(data) {
5
5
  this.data = data;
6
6
  }
7
7
  add(dimensionId, x, y, z) {
8
- const dimension = IWGDimensions.getDimension(dimensionId);
8
+ const dimension = WorldSimulationDimensions.getDimension(dimensionId);
9
9
  const task = dimension.getTask(this.data.id);
10
10
  if (task.vistedMap.has(x, y, z))
11
11
  return;
@@ -15,7 +15,7 @@ export class IWGTaskBase {
15
15
  task.vistedMap.add(x, y, z);
16
16
  }
17
17
  remove(dimensionId, x, y, z) {
18
- const dimension = IWGDimensions.getDimension(dimensionId);
18
+ const dimension = WorldSimulationDimensions.getDimension(dimensionId);
19
19
  const task = dimension.getTask(this.data.id);
20
20
  task.vistedMap.remove(x, y, z);
21
21
  if (this.data.propagationBlocking) {
@@ -24,18 +24,18 @@ export class IWGTaskBase {
24
24
  }
25
25
  cancelAll(dimensionId = null) {
26
26
  if (dimensionId) {
27
- const dimension = IWGDimensions.getDimension(dimensionId);
27
+ const dimension = WorldSimulationDimensions.getDimension(dimensionId);
28
28
  const task = dimension.getTask(this.data.id);
29
29
  task.clear();
30
30
  }
31
31
  else {
32
- for (const [key, dimension] of IWGDimensions._dimensions) {
32
+ for (const [key, dimension] of WorldSimulationDimensions._dimensions) {
33
33
  dimension.clearAllTasks();
34
34
  }
35
35
  }
36
36
  }
37
37
  runTask(max = 1000) {
38
- for (const [key, dimension] of IWGDimensions._dimensions) {
38
+ for (const [key, dimension] of WorldSimulationDimensions._dimensions) {
39
39
  const task = dimension.getTask(this.data.id);
40
40
  if (task.waitingFor < 0)
41
41
  task.waitingFor = 0;
@@ -47,12 +47,12 @@ export class IWGTaskBase {
47
47
  const z = task.queue.shift();
48
48
  task.waitingFor++;
49
49
  if (this.data.propagationBlocking) {
50
- dimension.inProgress.add(x, 0, z);
50
+ dimension.inProgress.add(x, y, z);
51
51
  }
52
52
  this.data.run([dimension.id, x, y, z], () => {
53
53
  task.vistedMap.remove(x, y, z);
54
54
  if (this.data.propagationBlocking) {
55
- dimension.inProgress.remove(x, 0, z);
55
+ dimension.inProgress.remove(x, y, z);
56
56
  }
57
57
  task.waitingFor--;
58
58
  }, dimension);
@@ -1,13 +1,13 @@
1
1
  import { Circle, Square } from "@amodx/math";
2
- import { IWGDimensions } from "../IWGDimensions";
3
- import { WorldRegister } from "../../../../World/WorldRegister";
4
- import { WorldSpaces } from "../../../../World/WorldSpaces";
5
- import { IWGTools } from "../IWGTools";
6
- import { WorldLock } from "../../../../World/Lock/WorldLock";
2
+ import { WorldSimulationDimensions } from "../WorldSimulationDimensions";
3
+ import { WorldRegister } from "../../../World/WorldRegister";
4
+ import { WorldSpaces } from "../../../World/WorldSpaces";
5
+ import { WorldSimulationTools } from "../WorldSimulationTools";
6
+ import { WorldLock } from "../../../World/Lock/WorldLock";
7
7
  const sectorSquare = new Square();
8
8
  export function cullSectors(generatos, cullGenerators) {
9
9
  const time = performance.now();
10
- for (const [, dimension] of IWGDimensions._dimensions) {
10
+ for (const [, dimension] of WorldSimulationDimensions._dimensions) {
11
11
  for (let i = dimension.unRenderQueue.nodes.length - 1; i > -1; i--) {
12
12
  const node = dimension.unRenderQueue.nodes[i];
13
13
  const [cx, cy, cz] = node.position;
@@ -31,7 +31,7 @@ export function cullSectors(generatos, cullGenerators) {
31
31
  if (delta > 5_000) {
32
32
  dimension.rendered.remove(cx, cy, cz);
33
33
  dimension.inProgress.add(cx, cy, cz);
34
- IWGTools.parent
34
+ WorldSimulationTools.parent
35
35
  .runTaskAsync("remove-sector", [dimension.id, cx, cy, cz])
36
36
  .then(() => {
37
37
  dimension.inProgress.remove(cx, cy, cz);
@@ -61,9 +61,9 @@ export function cullSectors(generatos, cullGenerators) {
61
61
  const delta = time - node.time;
62
62
  if (delta > 5_000) {
63
63
  dimension.unLoadQueue.removeIndex(i);
64
- if (IWGTools.worldStorage) {
64
+ if (WorldSimulationTools.worldStorage) {
65
65
  dimension.inProgress.add(cx, cy, cz);
66
- IWGTools.worldStorage
66
+ WorldSimulationTools.worldStorage
67
67
  .unloadSector([dimension.id, cx, cy, cz])
68
68
  .finally(() => {
69
69
  dimension.inProgress.remove(cx, cy, cz);
@@ -1,4 +1,4 @@
1
1
  import { SectorState } from "../Classes/SectorState";
2
- import { Sector } from "../../../../World/index";
2
+ import { Sector } from "../../../World/index";
3
3
  import { DimensionSegment } from "../Classes/DimensionSegment";
4
4
  export declare function getSectorState(sector: Sector, state: SectorState, segment: DimensionSegment): SectorState;
@@ -1,7 +1,7 @@
1
- import { WorldRegister } from "../../../../World/WorldRegister";
2
- import { $2dMooreNeighborhood } from "../../../../Math/CardinalNeighbors";
3
- import { WorldSpaces } from "../../../../World/WorldSpaces";
4
- import { Sector } from "../../../../World/index";
1
+ import { WorldRegister } from "../../../World/WorldRegister";
2
+ import { $2dMooreNeighborhood } from "../../../Math/CardinalNeighbors";
3
+ import { WorldSpaces } from "../../../World/WorldSpaces";
4
+ import { Sector } from "../../../World/index";
5
5
  import { Vector3Like } from "@amodx/math";
6
6
  const tempPosition = Vector3Like.Create();
7
7
  export function getSectorState(sector, state, segment) {
@@ -0,0 +1,2 @@
1
+ import { Generator } from "../Classes/Generator";
2
+ export declare function runTickUpdate(generators: Generator[]): void;
@@ -1,17 +1,39 @@
1
1
  import { Circle, Square } from "@amodx/math";
2
- import { WorldSpaces } from "../../../../World/WorldSpaces";
2
+ import { WorldSpaces } from "../../../World/WorldSpaces";
3
3
  import { SectorState } from "../Classes/SectorState";
4
- import { WorldRegister } from "../../../../World/WorldRegister";
4
+ import { WorldRegister } from "../../../World/WorldRegister";
5
5
  import { getSectorState } from "./getSectorState";
6
- import { IWGTasks } from "../IWGTasks";
7
- import { IWGDimensions } from "../IWGDimensions";
6
+ import { WorldSimulationDimensions } from "../WorldSimulationDimensions";
8
7
  const stateCursor = new SectorState();
9
8
  const sectorSquare = new Square();
10
- export function runBuildUpdate(generators) {
9
+ function buildCheck(dimenion, sector, generator, x, y, z) {
10
+ let rendered = true;
11
+ if (!dimenion.rendered.has(x, y, z)) {
12
+ rendered = false;
13
+ dimenion.rendered.add(x, y, z);
14
+ }
15
+ for (const section of sector.getRenerableSections()) {
16
+ if (rendered && (section.isInProgress() || !section.isDisplayDirty()))
17
+ continue;
18
+ section.setInProgress(true);
19
+ generator.buildQueue.add(dimenion.id, ...section.position);
20
+ }
21
+ }
22
+ function logicCheck(dimenion, sector, generator, x, y, z) {
23
+ if (!sector.isLogicDirty())
24
+ return false;
25
+ for (const section of sector.getLogicDirtySections()) {
26
+ if (section.isLogicUpdateInProgress() || !section.isLogicDirty())
27
+ continue;
28
+ section.setLogicUpdateInProgress(true);
29
+ generator.logicQueue.add(dimenion.id, ...section.position);
30
+ }
31
+ }
32
+ export function runTickUpdate(generators) {
11
33
  for (const generator of generators) {
12
34
  if (!generator._building)
13
35
  continue;
14
- const segment = IWGDimensions._dimensions.get(generator._dimension);
36
+ const segment = WorldSimulationDimensions._dimensions.get(generator._dimension);
15
37
  if (!segment)
16
38
  throw new Error(`No segment for dimensions ${generator._dimension} found.`);
17
39
  const queue = segment.queue;
@@ -39,13 +61,20 @@ export function runBuildUpdate(generators) {
39
61
  if (state.nWorldGenAllDone &&
40
62
  state.nSunAllDone &&
41
63
  state.nPropagtionAllDone) {
42
- if (segment.rendered.has(cx, cy, cz))
64
+ if (!segment.rendered.has(cx, cy, cz)) {
65
+ buildCheck(segment, sector, generator, cx, cy, cz);
43
66
  continue;
44
- IWGTasks.buildTasks.add(generator._dimension, cx, cy, cz);
67
+ }
68
+ if (sector.anySectionLogicDirty()) {
69
+ logicCheck(segment, sector, generator, cx, cy, cz);
70
+ }
71
+ if (sector.anySectionDisplayDirty()) {
72
+ buildCheck(segment, sector, generator, cx, cy, cz);
73
+ }
45
74
  }
46
75
  }
47
76
  }
48
- for (const [, dimension] of IWGDimensions._dimensions) {
77
+ for (const [, dimension] of WorldSimulationDimensions._dimensions) {
49
78
  dimension.vistedMap.clear();
50
79
  }
51
80
  }
@@ -1,17 +1,17 @@
1
1
  import { Circle, Square } from "@amodx/math";
2
2
  import { getSectorState } from "./getSectorState";
3
3
  import { SectorState } from "../Classes/SectorState";
4
- import { WorldRegister } from "../../../../World/WorldRegister";
5
- import { Sector } from "../../../../World";
6
- import { WorldLock } from "../../../../World/Lock/WorldLock";
7
- import { IWGTasks } from "../IWGTasks";
8
- import { IWGDimensions } from "../IWGDimensions";
9
- import { WorldSpaces } from "../../../../World/WorldSpaces";
4
+ import { WorldRegister } from "../../../World/WorldRegister";
5
+ import { Sector } from "../../../World";
6
+ import { WorldLock } from "../../../World/Lock/WorldLock";
7
+ import { WorldSimulationTasks } from "../WorldSimulationTasks";
8
+ import { WorldSimulationDimensions } from "../WorldSimulationDimensions";
9
+ import { WorldSpaces } from "../../../World/WorldSpaces";
10
10
  const stateCursor = new SectorState();
11
11
  const sectorSquare = new Square();
12
12
  export function runWorldUpdate(generators) {
13
13
  for (const generator of generators) {
14
- const segment = IWGDimensions._dimensions.get(generator._dimension);
14
+ const segment = WorldSimulationDimensions._dimensions.get(generator._dimension);
15
15
  if (!segment)
16
16
  throw new Error(`No segment for dimensions ${generator._dimension} found.`);
17
17
  const queue = segment.queue;
@@ -36,34 +36,34 @@ export function runWorldUpdate(generators) {
36
36
  continue;
37
37
  const sector = WorldRegister.sectors.get(generator._dimension, cx, cy, cz);
38
38
  if (!sector) {
39
- IWGTasks.worldLoadTasks.add(generator._dimension, cx, cy, cz);
39
+ WorldSimulationTasks.worldLoadTasks.add(generator._dimension, cx, cy, cz);
40
40
  continue;
41
41
  }
42
42
  const state = getSectorState(sector, stateCursor, segment);
43
43
  sector.getBitFlag(Sector.FlagIds.isWorldGenDone);
44
44
  if (state.allLoaded &&
45
45
  !sector.getBitFlag(Sector.FlagIds.isWorldGenDone)) {
46
- IWGTasks.worldGenTasks.add(generator._dimension, cx, cy, cz);
46
+ WorldSimulationTasks.worldGenTasks.add(generator._dimension, cx, cy, cz);
47
47
  continue;
48
48
  }
49
49
  if (state.nWorldGenAllDone &&
50
50
  !sector.getBitFlag(Sector.FlagIds.isWorldDecorDone)) {
51
- IWGTasks.worldDecorateTasks.add(generator._dimension, cx, cy, cz);
51
+ WorldSimulationTasks.worldDecorateTasks.add(generator._dimension, cx, cy, cz);
52
52
  continue;
53
53
  }
54
54
  if (state.nDecorAllDone &&
55
55
  !sector.getBitFlag(Sector.FlagIds.isWorldPropagationDone)) {
56
- IWGTasks.worldPropagationTasks.add(generator._dimension, cx, cy, cz);
56
+ WorldSimulationTasks.worldPropagationTasks.add(generator._dimension, cx, cy, cz);
57
57
  continue;
58
58
  }
59
59
  if (state.nPropagtionAllDone &&
60
60
  !sector.getBitFlag(Sector.FlagIds.isWorldSunDone)) {
61
- IWGTasks.worldSunTasks.add(generator._dimension, cx, cy, cz);
61
+ WorldSimulationTasks.worldSunTasks.add(generator._dimension, cx, cy, cz);
62
62
  continue;
63
63
  }
64
64
  }
65
65
  }
66
- for (const [key, dimension] of IWGDimensions._dimensions) {
66
+ for (const [key, dimension] of WorldSimulationDimensions._dimensions) {
67
67
  dimension.vistedMap.clear();
68
68
  }
69
69
  }
@@ -1,7 +1,7 @@
1
1
  import { DimensionSegment } from "./Classes/DimensionSegment";
2
- import { IWGTaskBase, IWGTasksData } from "./Classes/IWGTaskBase";
2
+ import { IWGTaskBase, WorldSimulationTaskBase } from "./Classes/WorldSimulationTaskBase";
3
3
  export declare class TaskRegister {
4
4
  static readonly tasks: IWGTaskBase[];
5
- static addTasks(data: IWGTasksData): IWGTaskBase;
5
+ static addTasks(data: WorldSimulationTaskBase): IWGTaskBase;
6
6
  static addToDimension(dimension: DimensionSegment): void;
7
7
  }
@@ -1,4 +1,4 @@
1
- import { IWGTaskBase } from "./Classes/IWGTaskBase";
1
+ import { IWGTaskBase } from "./Classes/WorldSimulationTaskBase";
2
2
  export class TaskRegister {
3
3
  static tasks = [];
4
4
  static addTasks(data) {
@@ -0,0 +1,6 @@
1
+ import { DimensionSegment } from "./Classes/DimensionSegment";
2
+ export declare class WorldSimulationDimensions {
3
+ static readonly _dimensions: Map<number, DimensionSegment>;
4
+ static addDimension(dimensionId: number): void;
5
+ static getDimension(dimensionId: number): DimensionSegment;
6
+ }
@@ -1,6 +1,6 @@
1
1
  import { DimensionSegment } from "./Classes/DimensionSegment";
2
2
  import { TaskRegister } from "./TaskRegister";
3
- export class IWGDimensions {
3
+ export class WorldSimulationDimensions {
4
4
  static _dimensions = new Map();
5
5
  static addDimension(dimensionId) {
6
6
  const segment = new DimensionSegment(dimensionId);
@@ -0,0 +1,30 @@
1
+ export declare class WorldSimulationTasks {
2
+ /**# Load Sectors
3
+ * ---
4
+ */
5
+ static readonly worldLoadTasks: import("./Classes/WorldSimulationTaskBase").IWGTaskBase;
6
+ /**# Generate Sectors
7
+ * ---
8
+ */
9
+ static readonly worldGenTasks: import("./Classes/WorldSimulationTaskBase").IWGTaskBase;
10
+ /**# Decorate Sectors
11
+ * ---
12
+ */
13
+ static readonly worldDecorateTasks: import("./Classes/WorldSimulationTaskBase").IWGTaskBase;
14
+ /**# World Sun
15
+ * ---
16
+ */
17
+ static readonly worldSunTasks: import("./Classes/WorldSimulationTaskBase").IWGTaskBase;
18
+ /**# World Propagation
19
+ * ---
20
+ */
21
+ static readonly worldPropagationTasks: import("./Classes/WorldSimulationTaskBase").IWGTaskBase;
22
+ /**# Save Sector
23
+ * ---
24
+ */
25
+ static readonly saveTasks: import("./Classes/WorldSimulationTaskBase").IWGTaskBase;
26
+ /**# Save & Unload Sector
27
+ * ---
28
+ */
29
+ static readonly saveAndUnloadTasks: import("./Classes/WorldSimulationTaskBase").IWGTaskBase;
30
+ }
@@ -1,8 +1,8 @@
1
- import { WorldRegister } from "../../../World/WorldRegister";
2
- import { Sector } from "../../../World/index";
3
- import { IWGTools } from "./IWGTools";
1
+ import { WorldRegister } from "../../World/WorldRegister";
2
+ import { Sector } from "../../World/index";
3
+ import { WorldSimulationTools } from "./WorldSimulationTools";
4
4
  import { TaskRegister } from "./TaskRegister";
5
- export class IWGTasks {
5
+ export class WorldSimulationTasks {
6
6
  /**# Load Sectors
7
7
  * ---
8
8
  */
@@ -14,11 +14,11 @@ export class IWGTasks {
14
14
  const sector = WorldRegister.sectors.get(location[0], x, y, z);
15
15
  if (sector)
16
16
  return onDone();
17
- if (!IWGTools.worldStorage) {
17
+ if (!WorldSimulationTools.worldStorage) {
18
18
  WorldRegister.sectors.new(location[0], x, y, z);
19
19
  return onDone();
20
20
  }
21
- const loaded = await IWGTools.worldStorage.loadSector([
21
+ const loaded = await WorldSimulationTools.worldStorage.loadSector([
22
22
  dimension,
23
23
  x,
24
24
  y,
@@ -42,7 +42,7 @@ export class IWGTasks {
42
42
  throw new Error(`Sector at ${location.toString()} does not exist when attempting generation.`);
43
43
  if (sector.getBitFlag(Sector.FlagIds.isWorldGenDone))
44
44
  return onDone();
45
- IWGTools.taskTool.generate.run([location, []], null, () => {
45
+ WorldSimulationTools.taskTool.generate.run([location, []], null, () => {
46
46
  sector.setBitFlag(Sector.FlagIds.isWorldGenDone, true);
47
47
  onDone();
48
48
  });
@@ -60,7 +60,7 @@ export class IWGTasks {
60
60
  throw new Error(`Sector at ${location.toString()} does not exist when attempting decoration.`);
61
61
  if (sector.getBitFlag(Sector.FlagIds.isWorldDecorDone))
62
62
  return onDone();
63
- IWGTools.taskTool.decorate.run([location, []], null, () => {
63
+ WorldSimulationTools.taskTool.decorate.run([location, []], null, () => {
64
64
  sector.setBitFlag(Sector.FlagIds.isWorldDecorDone, true);
65
65
  onDone();
66
66
  });
@@ -78,7 +78,7 @@ export class IWGTasks {
78
78
  throw new Error(`Sector at ${location.toString()} does not exist when attempting world sun.`);
79
79
  if (sector.getBitFlag(Sector.FlagIds.isWorldSunDone))
80
80
  return onDone();
81
- IWGTools.taskTool.worldSun.run(location, null, () => {
81
+ WorldSimulationTools.taskTool.worldSun.run(location, null, () => {
82
82
  sector.setBitFlag(Sector.FlagIds.isWorldSunDone, true);
83
83
  onDone();
84
84
  });
@@ -96,7 +96,7 @@ export class IWGTasks {
96
96
  throw new Error(`Sector at ${location.toString()} does not exist when attempting propagation.`);
97
97
  if (sector.getBitFlag(Sector.FlagIds.isWorldPropagationDone))
98
98
  return onDone();
99
- IWGTools.taskTool.propagation.run(location, null, () => {
99
+ WorldSimulationTools.taskTool.propagation.run(location, null, () => {
100
100
  sector.setBitFlag(Sector.FlagIds.isWorldPropagationDone, true);
101
101
  onDone();
102
102
  });
@@ -108,9 +108,9 @@ export class IWGTasks {
108
108
  static saveTasks = TaskRegister.addTasks({
109
109
  id: "save",
110
110
  async run(location, onDone) {
111
- if (!IWGTools.worldStorage)
111
+ if (!WorldSimulationTools.worldStorage)
112
112
  return onDone();
113
- await IWGTools.worldStorage.saveSector(location);
113
+ await WorldSimulationTools.worldStorage.saveSector(location);
114
114
  onDone();
115
115
  },
116
116
  });
@@ -120,20 +120,10 @@ export class IWGTasks {
120
120
  static saveAndUnloadTasks = TaskRegister.addTasks({
121
121
  id: "save_and_unload",
122
122
  async run(location, onDone) {
123
- if (!IWGTools.worldStorage)
123
+ if (!WorldSimulationTools.worldStorage)
124
124
  return onDone();
125
- await IWGTools.worldStorage.unloadSector(location);
125
+ await WorldSimulationTools.worldStorage.unloadSector(location);
126
126
  onDone();
127
127
  },
128
128
  });
129
- /**# Build Task
130
- * ---
131
- */
132
- static buildTasks = TaskRegister.addTasks({
133
- id: "build_tasks",
134
- async run(location, onDone, dimenion) {
135
- dimenion.rendered.add(location[1], location[2], location[3]);
136
- IWGTools.taskTool.build.sector.run(location, null, onDone);
137
- },
138
- });
139
129
  }
@@ -0,0 +1,8 @@
1
+ import { Thread } from "@amodx/threads";
2
+ import { TaskTool } from "../../Tools/Tasks/TasksTool";
3
+ import { WorldStorageInterface } from "../../World/Types/WorldStorage.interface";
4
+ export declare class WorldSimulationTools {
5
+ static taskTool: TaskTool;
6
+ static worldStorage: WorldStorageInterface | null;
7
+ static parent: Thread;
8
+ }
@@ -1,4 +1,4 @@
1
- export class IWGTools {
1
+ export class WorldSimulationTools {
2
2
  static taskTool;
3
3
  static worldStorage = null;
4
4
  static parent;
@@ -4,7 +4,7 @@ import { GeneratorData } from "../Internal/Classes/Generator";
4
4
  * Load the world without building.
5
5
  */
6
6
  export declare function InitalLoad(props: {
7
- dimension?: string;
7
+ dimension?: number;
8
8
  logTasks?: true;
9
9
  genData: Partial<GeneratorData>;
10
10
  }): Promise<unknown>;