@nice2dev/game-engine 1.3.15 → 1.3.16

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 (434) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/accessibility/Accessibility.js +152 -165
  3. package/dist/cjs/ai/AI.js +292 -294
  4. package/dist/cjs/ai/BehaviorTree.js +1029 -1113
  5. package/dist/cjs/ai/StateMachine.js +694 -756
  6. package/dist/cjs/animation/Animation.js +232 -241
  7. package/dist/cjs/audio/AudioAdvanced.js +221 -236
  8. package/dist/cjs/audio/AudioBridge.js +441 -435
  9. package/dist/cjs/audio/AudioManager.js +242 -259
  10. package/dist/cjs/build-cloud/BuildOrchestration.js +1059 -1098
  11. package/dist/cjs/build-cloud/GodotBuildCloud.js +641 -670
  12. package/dist/cjs/build-cloud/UnityBuildCloud.js +563 -610
  13. package/dist/cjs/build-cloud/UnrealBuildCloud.js +610 -635
  14. package/dist/cjs/core/EventBus.js +51 -56
  15. package/dist/cjs/core/GameClock.js +62 -66
  16. package/dist/cjs/core/GameConfig.js +72 -79
  17. package/dist/cjs/core/GameLoop.js +80 -89
  18. package/dist/cjs/core/ServiceLocator.js +61 -65
  19. package/dist/cjs/core/Validation.js +72 -82
  20. package/dist/cjs/core/math.js +108 -112
  21. package/dist/cjs/devtools/DevTools.js +542 -563
  22. package/dist/cjs/devtools/DeveloperExperience.js +521 -559
  23. package/dist/cjs/devtools/GameplayAnalytics.js +636 -646
  24. package/dist/cjs/dialogue/DialogueSystem.js +984 -986
  25. package/dist/cjs/docs/DocGenerator.js +339 -364
  26. package/dist/cjs/ecs/World.js +355 -371
  27. package/dist/cjs/editor/AchievementEditor.js +580 -636
  28. package/dist/cjs/editor/AdvancedEditor.js +184 -191
  29. package/dist/cjs/editor/AnimationRetargeting.js +696 -741
  30. package/dist/cjs/editor/AssetBrowser.js +1072 -1160
  31. package/dist/cjs/editor/AssetManager.js +187 -192
  32. package/dist/cjs/editor/ConsolePro.js +971 -1061
  33. package/dist/cjs/editor/CraftingEditor.js +680 -730
  34. package/dist/cjs/editor/DebugTools.js +187 -185
  35. package/dist/cjs/editor/DialogueSystem.js +844 -901
  36. package/dist/cjs/editor/LeaderboardSystem.js +429 -483
  37. package/dist/cjs/editor/NiceGameEditor.js +1903 -1201
  38. package/dist/cjs/editor/PrefabSystem.js +772 -838
  39. package/dist/cjs/editor/ProfilerPanel.js +649 -700
  40. package/dist/cjs/editor/QuestEditor.js +792 -839
  41. package/dist/cjs/editor/ReplaySystem.js +585 -634
  42. package/dist/cjs/editor/SceneEditor.js +176 -200
  43. package/dist/cjs/editor/ScreenshotMode.js +621 -688
  44. package/dist/cjs/editor/ShaderGraph.js +1556 -1582
  45. package/dist/cjs/editor/TimelineEditor.js +715 -778
  46. package/dist/cjs/editor/UndoRedoPro.js +830 -904
  47. package/dist/cjs/editor/VRARMode.js +582 -645
  48. package/dist/cjs/engine/NiceGameEngine.js +141 -164
  49. package/dist/cjs/engine/SaveSystem.js +441 -495
  50. package/dist/cjs/enterprise/Enterprise.js +254 -261
  51. package/dist/cjs/export/BevyExporter.js +927 -967
  52. package/dist/cjs/export/CocosExporter.js +644 -673
  53. package/dist/cjs/export/Construct3Exporter.js +783 -794
  54. package/dist/cjs/export/DefoldExporter.js +1028 -1069
  55. package/dist/cjs/export/GDevelopExporter.js +674 -708
  56. package/dist/cjs/export/GameMakerExporter.js +791 -805
  57. package/dist/cjs/export/GodotExporter.js +1003 -1045
  58. package/dist/cjs/export/MinecraftBedrockExporter.js +573 -578
  59. package/dist/cjs/export/MonoGameExporter.js +1265 -1293
  60. package/dist/cjs/export/Pico8Exporter.js +766 -812
  61. package/dist/cjs/export/PlatformExporter.js +188 -206
  62. package/dist/cjs/export/RPGMakerExporter.js +860 -879
  63. package/dist/cjs/export/RobloxExporter.js +883 -919
  64. package/dist/cjs/export/Solar2DExporter.js +1218 -1256
  65. package/dist/cjs/export/ThreeJSExporter.js +1006 -1073
  66. package/dist/cjs/export/Tic80Exporter.js +1210 -1267
  67. package/dist/cjs/export/UnityExporter.js +1116 -1131
  68. package/dist/cjs/export/UnrealExporter.js +889 -919
  69. package/dist/cjs/export/WebExporter.js +931 -970
  70. package/dist/cjs/export/index.js +42 -65
  71. package/dist/cjs/godot-integration/GodotAssetLibrary.js +659 -692
  72. package/dist/cjs/godot-integration/GodotImport.js +929 -1027
  73. package/dist/cjs/godot-integration/GodotLiveLink.js +915 -945
  74. package/dist/cjs/godot-integration/components/GodotProjectBrowser.js +911 -611
  75. package/dist/cjs/i18n/I18n.js +860 -900
  76. package/dist/cjs/i18n/useTranslation.js +84 -89
  77. package/dist/cjs/import/AsepriteImporter.js +658 -716
  78. package/dist/cjs/import/DragonBonesImporter.js +437 -461
  79. package/dist/cjs/import/GameMakerImporter.js +511 -521
  80. package/dist/cjs/import/GodotSceneImporter.js +788 -822
  81. package/dist/cjs/import/LDtkImporter.js +436 -454
  82. package/dist/cjs/import/Live2DImporter.js +497 -518
  83. package/dist/cjs/import/NdgFormat.js +424 -457
  84. package/dist/cjs/import/OgmoImporter.js +466 -493
  85. package/dist/cjs/import/RPGMakerImporter.js +451 -477
  86. package/dist/cjs/import/SceneImporter.js +378 -423
  87. package/dist/cjs/import/SpineImporter.js +511 -546
  88. package/dist/cjs/import/SpriterImporter.js +590 -613
  89. package/dist/cjs/import/TiledMapImporter.js +811 -846
  90. package/dist/cjs/import/UnitySceneImporter.js +687 -703
  91. package/dist/cjs/import/index.js +206 -251
  92. package/dist/cjs/index.js +275 -278
  93. package/dist/cjs/input/GamepadNavigation.js +185 -205
  94. package/dist/cjs/input/InputManager.js +397 -421
  95. package/dist/cjs/input/useGamepads.js +70 -81
  96. package/dist/cjs/integration/IconSprite.js +129 -256
  97. package/dist/cjs/inventory/InventorySystem.js +920 -995
  98. package/dist/cjs/kids/KidMode.js +997 -1022
  99. package/dist/cjs/kids/KidTools.js +570 -594
  100. package/dist/cjs/monetization/Monetization.js +170 -177
  101. package/dist/cjs/multiplayer/LocalMultiplayer.js +287 -287
  102. package/dist/cjs/multiplayer/MiniGameTypes.js +49 -59
  103. package/dist/cjs/native-engine/AnimationSystem.js +731 -806
  104. package/dist/cjs/native-engine/AssetPipeline.js +454 -515
  105. package/dist/cjs/native-engine/AudioEngine.js +763 -804
  106. package/dist/cjs/native-engine/InputSystem.js +1075 -1145
  107. package/dist/cjs/native-engine/NetworkingSystem.js +733 -793
  108. package/dist/cjs/native-engine/PhysicsEngine.js +583 -607
  109. package/dist/cjs/native-engine/RenderingEngine.js +302 -350
  110. package/dist/cjs/native-engine/SceneGraph.js +769 -808
  111. package/dist/cjs/network/MultiplayerTransport.js +97 -132
  112. package/dist/cjs/network/Networking.js +549 -564
  113. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/AbortController.js +21 -29
  114. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/AccessTokenHttpClient.js +40 -48
  115. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +35 -43
  116. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +10 -15
  117. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Errors.js +103 -135
  118. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +131 -158
  119. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +39 -53
  120. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +5 -8
  121. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +40 -48
  122. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +494 -572
  123. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +826 -953
  124. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +125 -146
  125. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +13 -23
  126. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ILogger.js +11 -25
  127. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ITransport.js +13 -24
  128. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +108 -121
  129. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Loggers.js +10 -14
  130. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +150 -185
  131. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/MessageBuffer.js +158 -196
  132. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +90 -105
  133. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Subject.js +30 -35
  134. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +16 -21
  135. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Utils.js +215 -248
  136. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +135 -157
  137. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +76 -85
  138. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/index.js +24 -27
  139. package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/pkg-version.js +3 -4
  140. package/dist/cjs/pathfinding/Pathfinding.js +245 -263
  141. package/dist/cjs/performance/AssetStreaming.js +561 -635
  142. package/dist/cjs/performance/BenchmarkSuite.js +283 -311
  143. package/dist/cjs/performance/DeltaCompression.js +467 -526
  144. package/dist/cjs/performance/DeterministicPhysics.js +450 -498
  145. package/dist/cjs/performance/ECSOptimization.js +644 -695
  146. package/dist/cjs/performance/GameSaveSystem.js +509 -556
  147. package/dist/cjs/performance/HotReload.js +447 -500
  148. package/dist/cjs/performance/InputRecording.js +511 -561
  149. package/dist/cjs/performance/InterestManagement.js +453 -500
  150. package/dist/cjs/performance/LocalizationRuntime.js +376 -423
  151. package/dist/cjs/performance/MemoryManagement.js +410 -470
  152. package/dist/cjs/performance/ModSupport.js +445 -496
  153. package/dist/cjs/performance/MultiThreadedPhysics.js +400 -443
  154. package/dist/cjs/performance/NetworkPrediction.js +424 -482
  155. package/dist/cjs/performance/ObjectPooling.js +569 -617
  156. package/dist/cjs/performance/Performance.js +174 -190
  157. package/dist/cjs/performance/PerformanceAdvanced.js +614 -637
  158. package/dist/cjs/performance/WebGPURenderer.js +656 -683
  159. package/dist/cjs/physics/PhysicsAdvanced.js +345 -379
  160. package/dist/cjs/physics/PhysicsEngine2D.js +391 -427
  161. package/dist/cjs/plugins/PluginSDK.js +432 -466
  162. package/dist/cjs/plugins/PluginTestKit.js +307 -330
  163. package/dist/cjs/procedural/Procedural.js +243 -254
  164. package/dist/cjs/procedural/WorldBuilding.js +297 -314
  165. package/dist/cjs/quest/QuestSystem.js +975 -932
  166. package/dist/cjs/release/MobileExport.js +157 -163
  167. package/dist/cjs/release/Release.js +225 -238
  168. package/dist/cjs/rendering/Camera2D.js +121 -124
  169. package/dist/cjs/rendering/Renderer2D.js +321 -335
  170. package/dist/cjs/rendering/WebGPURenderPipeline.js +632 -651
  171. package/dist/cjs/runtime3d/Runtime3D.js +359 -378
  172. package/dist/cjs/runtime3d/SceneEditor3D.js +252 -263
  173. package/dist/cjs/scene/SceneManager.js +177 -193
  174. package/dist/cjs/scripting/GraphToAST.js +574 -547
  175. package/dist/cjs/scripting/LanguageExporter.js +254 -279
  176. package/dist/cjs/scripting/NodeGraph.js +546 -570
  177. package/dist/cjs/scripting/ScriptAST.js +31 -39
  178. package/dist/cjs/scripting/VisualScripting2.js +1016 -1065
  179. package/dist/cjs/scripting/exporters/CSharpExporter.js +464 -496
  180. package/dist/cjs/scripting/exporters/GDScriptExporter.js +390 -442
  181. package/dist/cjs/scripting/exporters/LuaExporter.js +406 -447
  182. package/dist/cjs/scripting/exporters/PythonExporter.js +484 -549
  183. package/dist/cjs/scripting/exporters/RustExporter.js +459 -512
  184. package/dist/cjs/scripting/exporters/TypeScriptExporter.js +505 -556
  185. package/dist/cjs/social/Social.js +72 -80
  186. package/dist/cjs/systems/LightingSystem.js +844 -931
  187. package/dist/cjs/systems/ParticleSystem2.js +1447 -1451
  188. package/dist/cjs/systems/PhysicsDebugSystem.js +1070 -1141
  189. package/dist/cjs/systems/TerrainSystem.js +985 -1098
  190. package/dist/cjs/templates/ActionTemplates.js +296 -309
  191. package/dist/cjs/templates/FightingTemplate.js +417 -463
  192. package/dist/cjs/templates/MetroidvaniaTemplate.js +353 -405
  193. package/dist/cjs/templates/PartyTemplates.js +190 -202
  194. package/dist/cjs/templates/PuzzleTemplates.js +245 -261
  195. package/dist/cjs/templates/RPGTemplates.js +160 -178
  196. package/dist/cjs/templates/SportsTemplates.js +237 -250
  197. package/dist/cjs/templates/StrategyTemplates.js +143 -153
  198. package/dist/cjs/templates/SurvivalTemplate.js +336 -380
  199. package/dist/cjs/templates/WaveDefense.js +499 -526
  200. package/dist/cjs/tilemap/Tilemap.js +207 -214
  201. package/dist/cjs/tutorials/TutorialBranching.js +396 -417
  202. package/dist/cjs/tutorials/TutorialEngine.js +888 -931
  203. package/dist/cjs/tutorials/TutorialOverlay.js +602 -640
  204. package/dist/cjs/tutorials/content/Tutorials_T05_T08.js +787 -809
  205. package/dist/cjs/tutorials/content/Tutorials_T09_T11.js +736 -756
  206. package/dist/cjs/tutorials/content/Tutorials_T12_T15.js +754 -778
  207. package/dist/cjs/ui/GameUI.js +295 -312
  208. package/dist/cjs/unity-integration/UnityAssetStore.js +700 -741
  209. package/dist/cjs/unity-integration/UnityImport.js +1066 -1176
  210. package/dist/cjs/unity-integration/UnityLiveLink.js +934 -981
  211. package/dist/cjs/unity-integration/components/UnityAssetStoreBrowser.js +1233 -757
  212. package/dist/cjs/unity-integration/components/UnityProjectBrowser.js +1240 -768
  213. package/dist/cjs/unreal-integration/UnrealImport.js +391 -412
  214. package/dist/cjs/unreal-integration/UnrealLiveLink.js +1102 -1137
  215. package/dist/cjs/unreal-integration/UnrealMarketplace.js +436 -473
  216. package/dist/cjs/unreal-integration/components/UnrealProjectBrowser.js +1150 -767
  217. package/dist/cjs/xr/ARVR.js +167 -175
  218. package/dist/esm/accessibility/Accessibility.js +160 -164
  219. package/dist/esm/ai/AI.js +310 -293
  220. package/dist/esm/ai/BehaviorTree.js +1057 -1112
  221. package/dist/esm/ai/StateMachine.js +709 -755
  222. package/dist/esm/animation/Animation.js +237 -240
  223. package/dist/esm/audio/AudioAdvanced.js +239 -235
  224. package/dist/esm/audio/AudioBridge.js +448 -434
  225. package/dist/esm/audio/AudioManager.js +243 -258
  226. package/dist/esm/build-cloud/BuildOrchestration.js +1071 -1097
  227. package/dist/esm/build-cloud/GodotBuildCloud.js +647 -669
  228. package/dist/esm/build-cloud/UnityBuildCloud.js +571 -609
  229. package/dist/esm/build-cloud/UnrealBuildCloud.js +615 -634
  230. package/dist/esm/core/EventBus.js +52 -55
  231. package/dist/esm/core/GameClock.js +63 -65
  232. package/dist/esm/core/GameConfig.js +77 -78
  233. package/dist/esm/core/GameLoop.js +81 -88
  234. package/dist/esm/core/ServiceLocator.js +63 -64
  235. package/dist/esm/core/Validation.js +82 -81
  236. package/dist/esm/core/math.js +109 -111
  237. package/dist/esm/devtools/DevTools.js +546 -562
  238. package/dist/esm/devtools/DeveloperExperience.js +535 -558
  239. package/dist/esm/devtools/GameplayAnalytics.js +647 -645
  240. package/dist/esm/dialogue/DialogueSystem.js +998 -985
  241. package/dist/esm/docs/DocGenerator.js +342 -363
  242. package/dist/esm/ecs/World.js +358 -370
  243. package/dist/esm/editor/AchievementEditor.js +584 -635
  244. package/dist/esm/editor/AdvancedEditor.js +191 -190
  245. package/dist/esm/editor/AnimationRetargeting.js +700 -740
  246. package/dist/esm/editor/AssetBrowser.js +1078 -1159
  247. package/dist/esm/editor/AssetManager.js +188 -191
  248. package/dist/esm/editor/ConsolePro.js +977 -1060
  249. package/dist/esm/editor/CraftingEditor.js +684 -729
  250. package/dist/esm/editor/DebugTools.js +194 -184
  251. package/dist/esm/editor/DialogueSystem.js +849 -900
  252. package/dist/esm/editor/LeaderboardSystem.js +433 -482
  253. package/dist/esm/editor/NiceGameEditor.js +1908 -1200
  254. package/dist/esm/editor/PrefabSystem.js +777 -837
  255. package/dist/esm/editor/ProfilerPanel.js +654 -699
  256. package/dist/esm/editor/QuestEditor.js +795 -838
  257. package/dist/esm/editor/ReplaySystem.js +591 -633
  258. package/dist/esm/editor/SceneEditor.js +189 -199
  259. package/dist/esm/editor/ScreenshotMode.js +628 -687
  260. package/dist/esm/editor/ShaderGraph.js +1565 -1581
  261. package/dist/esm/editor/TimelineEditor.js +733 -777
  262. package/dist/esm/editor/UndoRedoPro.js +835 -903
  263. package/dist/esm/editor/VRARMode.js +586 -644
  264. package/dist/esm/engine/NiceGameEngine.js +142 -163
  265. package/dist/esm/engine/SaveSystem.js +447 -494
  266. package/dist/esm/enterprise/Enterprise.js +265 -260
  267. package/dist/esm/export/BevyExporter.js +929 -966
  268. package/dist/esm/export/CocosExporter.js +646 -672
  269. package/dist/esm/export/Construct3Exporter.js +785 -793
  270. package/dist/esm/export/DefoldExporter.js +1030 -1068
  271. package/dist/esm/export/GDevelopExporter.js +676 -707
  272. package/dist/esm/export/GameMakerExporter.js +793 -804
  273. package/dist/esm/export/GodotExporter.js +1004 -1044
  274. package/dist/esm/export/MinecraftBedrockExporter.js +575 -577
  275. package/dist/esm/export/MonoGameExporter.js +1267 -1292
  276. package/dist/esm/export/Pico8Exporter.js +768 -811
  277. package/dist/esm/export/PlatformExporter.js +193 -205
  278. package/dist/esm/export/RPGMakerExporter.js +862 -878
  279. package/dist/esm/export/RobloxExporter.js +885 -918
  280. package/dist/esm/export/Solar2DExporter.js +1220 -1255
  281. package/dist/esm/export/ThreeJSExporter.js +1007 -1072
  282. package/dist/esm/export/Tic80Exporter.js +1212 -1266
  283. package/dist/esm/export/UnityExporter.js +1117 -1130
  284. package/dist/esm/export/UnrealExporter.js +891 -918
  285. package/dist/esm/export/WebExporter.js +933 -969
  286. package/dist/esm/export/index.js +86 -71
  287. package/dist/esm/godot-integration/GodotAssetLibrary.js +663 -691
  288. package/dist/esm/godot-integration/GodotImport.js +935 -1026
  289. package/dist/esm/godot-integration/GodotLiveLink.js +918 -944
  290. package/dist/esm/godot-integration/components/GodotProjectBrowser.js +912 -610
  291. package/dist/esm/i18n/I18n.js +871 -899
  292. package/dist/esm/i18n/useTranslation.js +88 -88
  293. package/dist/esm/import/AsepriteImporter.js +637 -715
  294. package/dist/esm/import/DragonBonesImporter.js +417 -460
  295. package/dist/esm/import/GameMakerImporter.js +491 -520
  296. package/dist/esm/import/GodotSceneImporter.js +767 -821
  297. package/dist/esm/import/LDtkImporter.js +415 -453
  298. package/dist/esm/import/Live2DImporter.js +477 -517
  299. package/dist/esm/import/NdgFormat.js +410 -456
  300. package/dist/esm/import/OgmoImporter.js +446 -492
  301. package/dist/esm/import/RPGMakerImporter.js +431 -476
  302. package/dist/esm/import/SceneImporter.js +385 -422
  303. package/dist/esm/import/SpineImporter.js +491 -545
  304. package/dist/esm/import/SpriterImporter.js +570 -612
  305. package/dist/esm/import/TiledMapImporter.js +790 -845
  306. package/dist/esm/import/UnitySceneImporter.js +666 -702
  307. package/dist/esm/import/index.js +247 -258
  308. package/dist/esm/index.js +1332 -188
  309. package/dist/esm/input/GamepadNavigation.js +187 -204
  310. package/dist/esm/input/InputManager.js +401 -420
  311. package/dist/esm/input/useGamepads.js +72 -80
  312. package/dist/esm/integration/IconSprite.js +143 -255
  313. package/dist/esm/inventory/InventorySystem.js +925 -994
  314. package/dist/esm/kids/KidMode.js +1003 -1021
  315. package/dist/esm/kids/KidTools.js +573 -593
  316. package/dist/esm/monetization/Monetization.js +180 -176
  317. package/dist/esm/multiplayer/LocalMultiplayer.js +290 -286
  318. package/dist/esm/multiplayer/MiniGameTypes.js +58 -58
  319. package/dist/esm/native-engine/AnimationSystem.js +735 -805
  320. package/dist/esm/native-engine/AssetPipeline.js +456 -514
  321. package/dist/esm/native-engine/AudioEngine.js +765 -803
  322. package/dist/esm/native-engine/InputSystem.js +1079 -1144
  323. package/dist/esm/native-engine/NetworkingSystem.js +740 -792
  324. package/dist/esm/native-engine/PhysicsEngine.js +585 -606
  325. package/dist/esm/native-engine/RenderingEngine.js +304 -349
  326. package/dist/esm/native-engine/SceneGraph.js +773 -807
  327. package/dist/esm/network/MultiplayerTransport.js +99 -131
  328. package/dist/esm/network/Networking.js +556 -563
  329. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/AbortController.js +22 -28
  330. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/AccessTokenHttpClient.js +41 -47
  331. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +36 -42
  332. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +11 -14
  333. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Errors.js +111 -134
  334. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +132 -157
  335. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +40 -52
  336. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +6 -7
  337. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +42 -47
  338. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +496 -571
  339. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +828 -952
  340. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +126 -145
  341. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +14 -23
  342. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ILogger.js +12 -25
  343. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ITransport.js +15 -24
  344. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +109 -120
  345. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Loggers.js +11 -13
  346. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +151 -184
  347. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/MessageBuffer.js +159 -195
  348. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +91 -104
  349. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Subject.js +31 -34
  350. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +17 -20
  351. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Utils.js +230 -248
  352. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +136 -156
  353. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +77 -84
  354. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/index.js +31 -12
  355. package/dist/esm/node_modules/@microsoft/signalr/dist/esm/pkg-version.js +4 -3
  356. package/dist/esm/pathfinding/Pathfinding.js +249 -262
  357. package/dist/esm/performance/AssetStreaming.js +567 -634
  358. package/dist/esm/performance/BenchmarkSuite.js +285 -310
  359. package/dist/esm/performance/DeltaCompression.js +478 -525
  360. package/dist/esm/performance/DeterministicPhysics.js +479 -497
  361. package/dist/esm/performance/ECSOptimization.js +653 -694
  362. package/dist/esm/performance/GameSaveSystem.js +515 -555
  363. package/dist/esm/performance/HotReload.js +454 -499
  364. package/dist/esm/performance/InputRecording.js +520 -560
  365. package/dist/esm/performance/InterestManagement.js +460 -499
  366. package/dist/esm/performance/LocalizationRuntime.js +382 -422
  367. package/dist/esm/performance/MemoryManagement.js +415 -469
  368. package/dist/esm/performance/ModSupport.js +455 -495
  369. package/dist/esm/performance/MultiThreadedPhysics.js +408 -442
  370. package/dist/esm/performance/NetworkPrediction.js +436 -481
  371. package/dist/esm/performance/ObjectPooling.js +582 -616
  372. package/dist/esm/performance/Performance.js +182 -189
  373. package/dist/esm/performance/PerformanceAdvanced.js +621 -636
  374. package/dist/esm/performance/WebGPURenderer.js +660 -682
  375. package/dist/esm/physics/PhysicsAdvanced.js +359 -378
  376. package/dist/esm/physics/PhysicsEngine2D.js +393 -426
  377. package/dist/esm/plugins/PluginSDK.js +435 -465
  378. package/dist/esm/plugins/PluginTestKit.js +315 -329
  379. package/dist/esm/procedural/Procedural.js +248 -253
  380. package/dist/esm/procedural/WorldBuilding.js +316 -313
  381. package/dist/esm/quest/QuestSystem.js +982 -931
  382. package/dist/esm/release/MobileExport.js +163 -162
  383. package/dist/esm/release/Release.js +234 -237
  384. package/dist/esm/rendering/Camera2D.js +122 -123
  385. package/dist/esm/rendering/Renderer2D.js +323 -334
  386. package/dist/esm/rendering/WebGPURenderPipeline.js +647 -650
  387. package/dist/esm/runtime3d/Runtime3D.js +368 -377
  388. package/dist/esm/runtime3d/SceneEditor3D.js +268 -262
  389. package/dist/esm/scene/SceneManager.js +178 -192
  390. package/dist/esm/scripting/GraphToAST.js +576 -546
  391. package/dist/esm/scripting/LanguageExporter.js +263 -278
  392. package/dist/esm/scripting/NodeGraph.js +550 -569
  393. package/dist/esm/scripting/ScriptAST.js +45 -38
  394. package/dist/esm/scripting/VisualScripting2.js +1025 -1064
  395. package/dist/esm/scripting/exporters/CSharpExporter.js +465 -495
  396. package/dist/esm/scripting/exporters/GDScriptExporter.js +391 -441
  397. package/dist/esm/scripting/exporters/LuaExporter.js +407 -446
  398. package/dist/esm/scripting/exporters/PythonExporter.js +485 -548
  399. package/dist/esm/scripting/exporters/RustExporter.js +460 -511
  400. package/dist/esm/scripting/exporters/TypeScriptExporter.js +506 -555
  401. package/dist/esm/social/Social.js +77 -79
  402. package/dist/esm/systems/LightingSystem.js +855 -930
  403. package/dist/esm/systems/ParticleSystem2.js +1453 -1450
  404. package/dist/esm/systems/PhysicsDebugSystem.js +1078 -1140
  405. package/dist/esm/systems/TerrainSystem.js +996 -1097
  406. package/dist/esm/templates/ActionTemplates.js +307 -308
  407. package/dist/esm/templates/FightingTemplate.js +439 -462
  408. package/dist/esm/templates/MetroidvaniaTemplate.js +391 -404
  409. package/dist/esm/templates/PartyTemplates.js +206 -201
  410. package/dist/esm/templates/PuzzleTemplates.js +260 -260
  411. package/dist/esm/templates/RPGTemplates.js +172 -177
  412. package/dist/esm/templates/SportsTemplates.js +251 -249
  413. package/dist/esm/templates/StrategyTemplates.js +158 -152
  414. package/dist/esm/templates/SurvivalTemplate.js +367 -379
  415. package/dist/esm/templates/WaveDefense.js +501 -525
  416. package/dist/esm/tilemap/Tilemap.js +209 -213
  417. package/dist/esm/tutorials/TutorialBranching.js +399 -416
  418. package/dist/esm/tutorials/TutorialEngine.js +893 -930
  419. package/dist/esm/tutorials/TutorialOverlay.js +603 -639
  420. package/dist/esm/tutorials/content/Tutorials_T05_T08.js +792 -808
  421. package/dist/esm/tutorials/content/Tutorials_T09_T11.js +740 -755
  422. package/dist/esm/tutorials/content/Tutorials_T12_T15.js +759 -777
  423. package/dist/esm/ui/GameUI.js +296 -311
  424. package/dist/esm/unity-integration/UnityAssetStore.js +704 -740
  425. package/dist/esm/unity-integration/UnityImport.js +1071 -1175
  426. package/dist/esm/unity-integration/UnityLiveLink.js +938 -980
  427. package/dist/esm/unity-integration/components/UnityAssetStoreBrowser.js +1234 -756
  428. package/dist/esm/unity-integration/components/UnityProjectBrowser.js +1241 -767
  429. package/dist/esm/unreal-integration/UnrealImport.js +395 -411
  430. package/dist/esm/unreal-integration/UnrealLiveLink.js +1105 -1136
  431. package/dist/esm/unreal-integration/UnrealMarketplace.js +442 -472
  432. package/dist/esm/unreal-integration/components/UnrealProjectBrowser.js +1151 -766
  433. package/dist/esm/xr/ARVR.js +181 -174
  434. package/package.json +7 -12
@@ -1,854 +1,819 @@
1
- 'use strict';
2
-
3
- var SceneImporter = require('./SceneImporter.js');
4
-
5
- /**
6
- * @file TiledMapImporter.ts
7
- * @description Import Tiled Map Editor files (.tmx, .tsx)
8
- * PRO-1.3: Scene Format Interoperability
9
- *
10
- * Supports:
11
- * - Tiled Map files (.tmx, .tmj)
12
- * - Tileset files (.tsx, .tsj)
13
- * - Template files (.tx, .tj)
14
- * - World files (.world)
15
- *
16
- * Features:
17
- * - Tile layers
18
- * - Object layers
19
- * - Image layers
20
- * - Group layers
21
- * - Animations
22
- * - Custom properties
23
- * - Collision shapes
24
- */
25
- // ============================================================
26
- // Tiled Map Importer
27
- // ============================================================
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (let key of __getOwnPropNames(from))
11
+ if (!__hasOwnProp.call(to, key) && key !== except)
12
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
13
+ }
14
+ return to;
15
+ };
16
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
17
+ // If the importer is in node compatibility mode or this is not an ESM
18
+ // file that has been converted to a CommonJS file using a Babel-
19
+ // compatible transform (i.e. "__esModule" has not been set), then set
20
+ // "default" to the CommonJS "module.exports" for node compatibility.
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
25
+ const SceneImporter = require("./SceneImporter.js");
28
26
  class TiledMapImporter extends SceneImporter.SceneImporter {
29
- constructor() {
30
- super('tiled');
31
- this.tilesets = new Map();
32
- this.tilesetsById = new Map();
33
- }
34
- async import(options) {
35
- const startTime = Date.now();
36
- this.options = options;
37
- this.clearMessages();
38
- this.tilesets.clear();
39
- this.tilesetsById.clear();
40
- const errors = await this.validate(options.sourcePath);
41
- if (errors.some((e) => e.fatal)) {
42
- return {
43
- ...this.createEmptyResult(),
44
- errors: errors,
45
- };
46
- }
47
- const scenes = [];
48
- const assets = [];
49
- try {
50
- const content = await this.readFile(options.sourcePath);
51
- const isJson = options.sourcePath.endsWith('.tmj') || options.sourcePath.endsWith('.json');
52
- const map = isJson ? this.parseJsonMap(content) : this.parseXmlMap(content);
53
- if (map) {
54
- // Parse external tilesets
55
- await this.loadExternalTilesets(map, options.sourcePath);
56
- const parsed = this.convertTiledMapToScene(map);
57
- const niceScene = this.convertParsedToNiceScene(parsed);
58
- scenes.push(niceScene);
59
- const extractedAssets = this.extractAssets(map);
60
- assets.push(...extractedAssets);
61
- }
62
- }
63
- catch (error) {
64
- this.addError('IMPORT_ERROR', `Failed to import: ${error}`, options.sourcePath, undefined, true);
65
- }
66
- return this.createResult(scenes, assets, startTime);
67
- }
68
- async parseFile(content, filePath) {
69
- const stringContent = typeof content === 'string' ? content : new TextDecoder().decode(content);
70
- const isJson = filePath.endsWith('.tmj') || filePath.endsWith('.json');
71
- const map = isJson ? this.parseJsonMap(stringContent) : this.parseXmlMap(stringContent);
72
- if (!map) {
73
- return null;
74
- }
75
- return this.convertTiledMapToScene(map);
76
- }
77
- async validate(sourcePath) {
78
- const errors = [];
79
- if (!this.canHandle(sourcePath)) {
80
- errors.push({
81
- code: 'INVALID_FORMAT',
82
- message: `File ${sourcePath} is not a valid Tiled file`,
83
- file: sourcePath,
84
- fatal: true,
85
- });
86
- }
87
- return errors;
88
- }
89
- // ----------------------------------------
90
- // Tiled Parsing
91
- // ----------------------------------------
92
- parseJsonMap(content) {
93
- try {
94
- const json = JSON.parse(content);
95
- return this.normalizeJsonMap(json);
96
- }
97
- catch (error) {
98
- this.addError('JSON_PARSE_ERROR', `Failed to parse JSON: ${error}`);
99
- return null;
100
- }
101
- }
102
- normalizeJsonMap(json) {
103
- return {
104
- version: String(json.version || '1.0'),
105
- tiledVersion: String(json.tiledversion || ''),
106
- orientation: json.orientation || 'orthogonal',
107
- renderOrder: json.renderorder || 'right-down',
108
- width: Number(json.width) || 0,
109
- height: Number(json.height) || 0,
110
- tileWidth: Number(json.tilewidth) || 0,
111
- tileHeight: Number(json.tileheight) || 0,
112
- infinite: Boolean(json.infinite),
113
- backgroundColor: json.backgroundcolor ? String(json.backgroundcolor) : undefined,
114
- nextLayerId: Number(json.nextlayerid) || 0,
115
- nextObjectId: Number(json.nextobjectid) || 0,
116
- parallaxOriginX: json.parallaxoriginx ? Number(json.parallaxoriginx) : undefined,
117
- parallaxOriginY: json.parallaxoriginy ? Number(json.parallaxoriginy) : undefined,
118
- tilesets: json.tilesets?.map((ts) => this.normalizeJsonTileset(ts)) || [],
119
- layers: json.layers?.map((l) => this.normalizeJsonLayer(l)) || [],
120
- properties: this.normalizeProperties(json.properties),
121
- hexSideLength: json.hexsidelength ? Number(json.hexsidelength) : undefined,
122
- staggerAxis: json.staggeraxis,
123
- staggerIndex: json.staggerindex,
124
- };
125
- }
126
- normalizeJsonTileset(json) {
127
- const tileset = {
128
- firstGid: Number(json.firstgid) || 0,
129
- source: json.source ? String(json.source) : undefined,
130
- name: String(json.name || ''),
131
- tileWidth: Number(json.tilewidth) || 0,
132
- tileHeight: Number(json.tileheight) || 0,
133
- spacing: Number(json.spacing) || 0,
134
- margin: Number(json.margin) || 0,
135
- tileCount: Number(json.tilecount) || 0,
136
- columns: Number(json.columns) || 0,
137
- image: json.image ? String(json.image) : undefined,
138
- imageWidth: json.imagewidth ? Number(json.imagewidth) : undefined,
139
- imageHeight: json.imageheight ? Number(json.imageheight) : undefined,
140
- transparentColor: json.transparentcolor ? String(json.transparentcolor) : undefined,
141
- properties: this.normalizeProperties(json.properties),
142
- };
143
- if (json.tiles) {
144
- tileset.tiles = json.tiles.map((t) => this.normalizeJsonTile(t));
145
- }
146
- if (json.tileoffset) {
147
- const offset = json.tileoffset;
148
- tileset.tileOffset = { x: Number(offset.x) || 0, y: Number(offset.y) || 0 };
149
- }
150
- return tileset;
151
- }
152
- normalizeJsonTile(json) {
153
- const tile = {
154
- id: Number(json.id) || 0,
155
- type: json.type ? String(json.type) : undefined,
156
- properties: this.normalizeProperties(json.properties),
157
- };
158
- if (json.animation) {
159
- tile.animation = json.animation.map((f) => ({
160
- tileId: Number(f.tileid),
161
- duration: Number(f.duration),
162
- }));
163
- }
164
- if (json.objectgroup) {
165
- const og = json.objectgroup;
166
- tile.objectGroup = {
167
- drawOrder: String(og.draworder || 'index'),
168
- id: Number(og.id) || 0,
169
- name: String(og.name || ''),
170
- objects: og.objects?.map((o) => this.normalizeJsonObject(o)) || [],
171
- };
172
- }
173
- return tile;
174
- }
175
- normalizeJsonLayer(json) {
176
- const layer = {
177
- id: Number(json.id) || 0,
178
- name: String(json.name || ''),
179
- type: json.type || 'tilelayer',
180
- visible: json.visible !== false,
181
- opacity: json.opacity !== undefined ? Number(json.opacity) : 1,
182
- offsetX: Number(json.offsetx) || 0,
183
- offsetY: Number(json.offsety) || 0,
184
- parallaxX: json.parallaxx !== undefined ? Number(json.parallaxx) : 1,
185
- parallaxY: json.parallaxy !== undefined ? Number(json.parallaxy) : 1,
186
- tintColor: json.tintcolor ? String(json.tintcolor) : undefined,
187
- locked: json.locked ? Boolean(json.locked) : undefined,
188
- class: json.class ? String(json.class) : undefined,
189
- properties: this.normalizeProperties(json.properties),
190
- };
191
- // Tile layer specific
192
- if (json.type === 'tilelayer') {
193
- layer.width = Number(json.width) || 0;
194
- layer.height = Number(json.height) || 0;
195
- layer.data = json.data;
196
- layer.encoding = json.encoding;
197
- layer.compression = json.compression;
198
- if (json.chunks) {
199
- layer.chunks = json.chunks.map((c) => {
200
- const chunk = c;
201
- return {
202
- x: Number(chunk.x),
203
- y: Number(chunk.y),
204
- width: Number(chunk.width),
205
- height: Number(chunk.height),
206
- data: chunk.data,
207
- };
208
- });
209
- }
210
- }
211
- // Object layer specific
212
- if (json.type === 'objectgroup') {
213
- layer.objects =
214
- json.objects?.map((o) => this.normalizeJsonObject(o)) || [];
215
- layer.drawOrder = json.draworder || 'topdown';
216
- layer.color = json.color ? String(json.color) : undefined;
217
- }
218
- // Image layer specific
219
- if (json.type === 'imagelayer') {
220
- layer.image = json.image ? String(json.image) : undefined;
221
- layer.repeatX = json.repeatx ? Boolean(json.repeatx) : undefined;
222
- layer.repeatY = json.repeaty ? Boolean(json.repeaty) : undefined;
223
- }
224
- // Group layer specific
225
- if (json.type === 'group' && json.layers) {
226
- layer.layers = json.layers.map((l) => this.normalizeJsonLayer(l));
227
- }
228
- return layer;
229
- }
230
- normalizeJsonObject(json) {
231
- return {
232
- id: Number(json.id) || 0,
233
- name: String(json.name || ''),
234
- type: String(json.type || json.class || ''),
235
- x: Number(json.x) || 0,
236
- y: Number(json.y) || 0,
237
- width: Number(json.width) || 0,
238
- height: Number(json.height) || 0,
239
- rotation: Number(json.rotation) || 0,
240
- visible: json.visible !== false,
241
- gid: json.gid ? Number(json.gid) : undefined,
242
- template: json.template ? String(json.template) : undefined,
243
- point: json.point ? Boolean(json.point) : undefined,
244
- ellipse: json.ellipse ? Boolean(json.ellipse) : undefined,
245
- polygon: json.polygon,
246
- polyline: json.polyline,
247
- text: json.text,
248
- properties: this.normalizeProperties(json.properties),
249
- };
250
- }
251
- normalizeProperties(props) {
252
- if (!props) {
253
- return undefined;
254
- }
255
- return props.map((p) => {
256
- const prop = p;
257
- return {
258
- name: String(prop.name || ''),
259
- type: prop.type || 'string',
260
- value: prop.value,
261
- propertyType: prop.propertytype ? String(prop.propertytype) : undefined,
262
- };
27
+ constructor() {
28
+ super("tiled");
29
+ this.tilesets = /* @__PURE__ */ new Map();
30
+ this.tilesetsById = /* @__PURE__ */ new Map();
31
+ }
32
+ async import(options) {
33
+ const startTime = Date.now();
34
+ this.options = options;
35
+ this.clearMessages();
36
+ this.tilesets.clear();
37
+ this.tilesetsById.clear();
38
+ const errors = await this.validate(options.sourcePath);
39
+ if (errors.some((e) => e.fatal)) {
40
+ return {
41
+ ...this.createEmptyResult(),
42
+ errors
43
+ };
44
+ }
45
+ const scenes = [];
46
+ const assets = [];
47
+ try {
48
+ const content = await this.readFile(options.sourcePath);
49
+ const isJson = options.sourcePath.endsWith(".tmj") || options.sourcePath.endsWith(".json");
50
+ const map = isJson ? this.parseJsonMap(content) : this.parseXmlMap(content);
51
+ if (map) {
52
+ await this.loadExternalTilesets(map, options.sourcePath);
53
+ const parsed = this.convertTiledMapToScene(map);
54
+ const niceScene = this.convertParsedToNiceScene(parsed);
55
+ scenes.push(niceScene);
56
+ const extractedAssets = this.extractAssets(map);
57
+ assets.push(...extractedAssets);
58
+ }
59
+ } catch (error) {
60
+ this.addError(
61
+ "IMPORT_ERROR",
62
+ `Failed to import: ${error}`,
63
+ options.sourcePath,
64
+ void 0,
65
+ true
66
+ );
67
+ }
68
+ return this.createResult(scenes, assets, startTime);
69
+ }
70
+ async parseFile(content, filePath) {
71
+ const stringContent = typeof content === "string" ? content : new TextDecoder().decode(content);
72
+ const isJson = filePath.endsWith(".tmj") || filePath.endsWith(".json");
73
+ const map = isJson ? this.parseJsonMap(stringContent) : this.parseXmlMap(stringContent);
74
+ if (!map) {
75
+ return null;
76
+ }
77
+ return this.convertTiledMapToScene(map);
78
+ }
79
+ async validate(sourcePath) {
80
+ const errors = [];
81
+ if (!this.canHandle(sourcePath)) {
82
+ errors.push({
83
+ code: "INVALID_FORMAT",
84
+ message: `File ${sourcePath} is not a valid Tiled file`,
85
+ file: sourcePath,
86
+ fatal: true
87
+ });
88
+ }
89
+ return errors;
90
+ }
91
+ // ----------------------------------------
92
+ // Tiled Parsing
93
+ // ----------------------------------------
94
+ parseJsonMap(content) {
95
+ try {
96
+ const json = JSON.parse(content);
97
+ return this.normalizeJsonMap(json);
98
+ } catch (error) {
99
+ this.addError("JSON_PARSE_ERROR", `Failed to parse JSON: ${error}`);
100
+ return null;
101
+ }
102
+ }
103
+ normalizeJsonMap(json) {
104
+ return {
105
+ version: String(json.version || "1.0"),
106
+ tiledVersion: String(json.tiledversion || ""),
107
+ orientation: json.orientation || "orthogonal",
108
+ renderOrder: json.renderorder || "right-down",
109
+ width: Number(json.width) || 0,
110
+ height: Number(json.height) || 0,
111
+ tileWidth: Number(json.tilewidth) || 0,
112
+ tileHeight: Number(json.tileheight) || 0,
113
+ infinite: Boolean(json.infinite),
114
+ backgroundColor: json.backgroundcolor ? String(json.backgroundcolor) : void 0,
115
+ nextLayerId: Number(json.nextlayerid) || 0,
116
+ nextObjectId: Number(json.nextobjectid) || 0,
117
+ parallaxOriginX: json.parallaxoriginx ? Number(json.parallaxoriginx) : void 0,
118
+ parallaxOriginY: json.parallaxoriginy ? Number(json.parallaxoriginy) : void 0,
119
+ tilesets: json.tilesets?.map(
120
+ (ts) => this.normalizeJsonTileset(ts)
121
+ ) || [],
122
+ layers: json.layers?.map(
123
+ (l) => this.normalizeJsonLayer(l)
124
+ ) || [],
125
+ properties: this.normalizeProperties(json.properties),
126
+ hexSideLength: json.hexsidelength ? Number(json.hexsidelength) : void 0,
127
+ staggerAxis: json.staggeraxis,
128
+ staggerIndex: json.staggerindex
129
+ };
130
+ }
131
+ normalizeJsonTileset(json) {
132
+ const tileset = {
133
+ firstGid: Number(json.firstgid) || 0,
134
+ source: json.source ? String(json.source) : void 0,
135
+ name: String(json.name || ""),
136
+ tileWidth: Number(json.tilewidth) || 0,
137
+ tileHeight: Number(json.tileheight) || 0,
138
+ spacing: Number(json.spacing) || 0,
139
+ margin: Number(json.margin) || 0,
140
+ tileCount: Number(json.tilecount) || 0,
141
+ columns: Number(json.columns) || 0,
142
+ image: json.image ? String(json.image) : void 0,
143
+ imageWidth: json.imagewidth ? Number(json.imagewidth) : void 0,
144
+ imageHeight: json.imageheight ? Number(json.imageheight) : void 0,
145
+ transparentColor: json.transparentcolor ? String(json.transparentcolor) : void 0,
146
+ properties: this.normalizeProperties(json.properties)
147
+ };
148
+ if (json.tiles) {
149
+ tileset.tiles = json.tiles.map(
150
+ (t) => this.normalizeJsonTile(t)
151
+ );
152
+ }
153
+ if (json.tileoffset) {
154
+ const offset = json.tileoffset;
155
+ tileset.tileOffset = { x: Number(offset.x) || 0, y: Number(offset.y) || 0 };
156
+ }
157
+ return tileset;
158
+ }
159
+ normalizeJsonTile(json) {
160
+ const tile = {
161
+ id: Number(json.id) || 0,
162
+ type: json.type ? String(json.type) : void 0,
163
+ properties: this.normalizeProperties(json.properties)
164
+ };
165
+ if (json.animation) {
166
+ tile.animation = json.animation.map((f) => ({
167
+ tileId: Number(f.tileid),
168
+ duration: Number(f.duration)
169
+ }));
170
+ }
171
+ if (json.objectgroup) {
172
+ const og = json.objectgroup;
173
+ tile.objectGroup = {
174
+ drawOrder: String(og.draworder || "index"),
175
+ id: Number(og.id) || 0,
176
+ name: String(og.name || ""),
177
+ objects: og.objects?.map(
178
+ (o) => this.normalizeJsonObject(o)
179
+ ) || []
180
+ };
181
+ }
182
+ return tile;
183
+ }
184
+ normalizeJsonLayer(json) {
185
+ const layer = {
186
+ id: Number(json.id) || 0,
187
+ name: String(json.name || ""),
188
+ type: json.type || "tilelayer",
189
+ visible: json.visible !== false,
190
+ opacity: json.opacity !== void 0 ? Number(json.opacity) : 1,
191
+ offsetX: Number(json.offsetx) || 0,
192
+ offsetY: Number(json.offsety) || 0,
193
+ parallaxX: json.parallaxx !== void 0 ? Number(json.parallaxx) : 1,
194
+ parallaxY: json.parallaxy !== void 0 ? Number(json.parallaxy) : 1,
195
+ tintColor: json.tintcolor ? String(json.tintcolor) : void 0,
196
+ locked: json.locked ? Boolean(json.locked) : void 0,
197
+ class: json.class ? String(json.class) : void 0,
198
+ properties: this.normalizeProperties(json.properties)
199
+ };
200
+ if (json.type === "tilelayer") {
201
+ layer.width = Number(json.width) || 0;
202
+ layer.height = Number(json.height) || 0;
203
+ layer.data = json.data;
204
+ layer.encoding = json.encoding;
205
+ layer.compression = json.compression;
206
+ if (json.chunks) {
207
+ layer.chunks = json.chunks.map((c) => {
208
+ const chunk = c;
209
+ return {
210
+ x: Number(chunk.x),
211
+ y: Number(chunk.y),
212
+ width: Number(chunk.width),
213
+ height: Number(chunk.height),
214
+ data: chunk.data
215
+ };
263
216
  });
264
- }
265
- parseXmlMap(content) {
217
+ }
218
+ }
219
+ if (json.type === "objectgroup") {
220
+ layer.objects = json.objects?.map(
221
+ (o) => this.normalizeJsonObject(o)
222
+ ) || [];
223
+ layer.drawOrder = json.draworder || "topdown";
224
+ layer.color = json.color ? String(json.color) : void 0;
225
+ }
226
+ if (json.type === "imagelayer") {
227
+ layer.image = json.image ? String(json.image) : void 0;
228
+ layer.repeatX = json.repeatx ? Boolean(json.repeatx) : void 0;
229
+ layer.repeatY = json.repeaty ? Boolean(json.repeaty) : void 0;
230
+ }
231
+ if (json.type === "group" && json.layers) {
232
+ layer.layers = json.layers.map(
233
+ (l) => this.normalizeJsonLayer(l)
234
+ );
235
+ }
236
+ return layer;
237
+ }
238
+ normalizeJsonObject(json) {
239
+ return {
240
+ id: Number(json.id) || 0,
241
+ name: String(json.name || ""),
242
+ type: String(json.type || json.class || ""),
243
+ x: Number(json.x) || 0,
244
+ y: Number(json.y) || 0,
245
+ width: Number(json.width) || 0,
246
+ height: Number(json.height) || 0,
247
+ rotation: Number(json.rotation) || 0,
248
+ visible: json.visible !== false,
249
+ gid: json.gid ? Number(json.gid) : void 0,
250
+ template: json.template ? String(json.template) : void 0,
251
+ point: json.point ? Boolean(json.point) : void 0,
252
+ ellipse: json.ellipse ? Boolean(json.ellipse) : void 0,
253
+ polygon: json.polygon,
254
+ polyline: json.polyline,
255
+ text: json.text,
256
+ properties: this.normalizeProperties(json.properties)
257
+ };
258
+ }
259
+ normalizeProperties(props) {
260
+ if (!props) {
261
+ return void 0;
262
+ }
263
+ return props.map((p) => {
264
+ const prop = p;
265
+ return {
266
+ name: String(prop.name || ""),
267
+ type: prop.type || "string",
268
+ value: prop.value,
269
+ propertyType: prop.propertytype ? String(prop.propertytype) : void 0
270
+ };
271
+ });
272
+ }
273
+ parseXmlMap(content) {
274
+ try {
275
+ const xml = SceneImporter.parseXML(content);
276
+ return this.normalizeXmlMap(xml);
277
+ } catch (error) {
278
+ this.addError("XML_PARSE_ERROR", `Failed to parse XML: ${error}`);
279
+ return null;
280
+ }
281
+ }
282
+ normalizeXmlMap(xml) {
283
+ const map = {
284
+ version: xml.attributes.version || "1.0",
285
+ tiledVersion: xml.attributes.tiledversion || "",
286
+ orientation: xml.attributes.orientation || "orthogonal",
287
+ renderOrder: xml.attributes.renderorder || "right-down",
288
+ width: parseInt(xml.attributes.width || "0", 10),
289
+ height: parseInt(xml.attributes.height || "0", 10),
290
+ tileWidth: parseInt(xml.attributes.tilewidth || "0", 10),
291
+ tileHeight: parseInt(xml.attributes.tileheight || "0", 10),
292
+ infinite: xml.attributes.infinite === "1",
293
+ backgroundColor: xml.attributes.backgroundcolor,
294
+ nextLayerId: parseInt(xml.attributes.nextlayerid || "0", 10),
295
+ nextObjectId: parseInt(xml.attributes.nextobjectid || "0", 10),
296
+ tilesets: [],
297
+ layers: [],
298
+ properties: this.parseXmlProperties(xml.children.find((c) => c.name === "properties"))
299
+ };
300
+ for (const child of xml.children.filter((c) => c.name === "tileset")) {
301
+ map.tilesets.push(this.normalizeXmlTileset(child));
302
+ }
303
+ for (const child of xml.children) {
304
+ if (["layer", "objectgroup", "imagelayer", "group"].includes(child.name)) {
305
+ map.layers.push(this.normalizeXmlLayer(child));
306
+ }
307
+ }
308
+ return map;
309
+ }
310
+ normalizeXmlTileset(xml) {
311
+ const tileset = {
312
+ firstGid: parseInt(xml.attributes.firstgid || "0", 10),
313
+ source: xml.attributes.source,
314
+ name: xml.attributes.name || "",
315
+ tileWidth: parseInt(xml.attributes.tilewidth || "0", 10),
316
+ tileHeight: parseInt(xml.attributes.tileheight || "0", 10),
317
+ spacing: parseInt(xml.attributes.spacing || "0", 10),
318
+ margin: parseInt(xml.attributes.margin || "0", 10),
319
+ tileCount: parseInt(xml.attributes.tilecount || "0", 10),
320
+ columns: parseInt(xml.attributes.columns || "0", 10),
321
+ properties: this.parseXmlProperties(xml.children.find((c) => c.name === "properties"))
322
+ };
323
+ const image = xml.children.find((c) => c.name === "image");
324
+ if (image) {
325
+ tileset.image = image.attributes.source;
326
+ tileset.imageWidth = parseInt(image.attributes.width || "0", 10);
327
+ tileset.imageHeight = parseInt(image.attributes.height || "0", 10);
328
+ tileset.transparentColor = image.attributes.trans;
329
+ }
330
+ const tiles = xml.children.filter((c) => c.name === "tile");
331
+ if (tiles.length > 0) {
332
+ tileset.tiles = tiles.map((t) => this.normalizeXmlTile(t));
333
+ }
334
+ const offset = xml.children.find((c) => c.name === "tileoffset");
335
+ if (offset) {
336
+ tileset.tileOffset = {
337
+ x: parseInt(offset.attributes.x || "0", 10),
338
+ y: parseInt(offset.attributes.y || "0", 10)
339
+ };
340
+ }
341
+ return tileset;
342
+ }
343
+ normalizeXmlTile(xml) {
344
+ const tile = {
345
+ id: parseInt(xml.attributes.id || "0", 10),
346
+ type: xml.attributes.type,
347
+ properties: this.parseXmlProperties(xml.children.find((c) => c.name === "properties"))
348
+ };
349
+ const animation = xml.children.find((c) => c.name === "animation");
350
+ if (animation) {
351
+ tile.animation = animation.children.filter((c) => c.name === "frame").map((f) => ({
352
+ tileId: parseInt(f.attributes.tileid || "0", 10),
353
+ duration: parseInt(f.attributes.duration || "0", 10)
354
+ }));
355
+ }
356
+ const objectGroup = xml.children.find((c) => c.name === "objectgroup");
357
+ if (objectGroup) {
358
+ tile.objectGroup = {
359
+ drawOrder: objectGroup.attributes.draworder || "index",
360
+ id: parseInt(objectGroup.attributes.id || "0", 10),
361
+ name: objectGroup.attributes.name || "",
362
+ objects: objectGroup.children.filter((c) => c.name === "object").map((o) => this.normalizeXmlObject(o))
363
+ };
364
+ }
365
+ return tile;
366
+ }
367
+ normalizeXmlLayer(xml) {
368
+ const type = this.getLayerType(xml.name);
369
+ const layer = {
370
+ id: parseInt(xml.attributes.id || "0", 10),
371
+ name: xml.attributes.name || "",
372
+ type,
373
+ visible: xml.attributes.visible !== "0",
374
+ opacity: parseFloat(xml.attributes.opacity || "1"),
375
+ offsetX: parseFloat(xml.attributes.offsetx || "0"),
376
+ offsetY: parseFloat(xml.attributes.offsety || "0"),
377
+ parallaxX: parseFloat(xml.attributes.parallaxx || "1"),
378
+ parallaxY: parseFloat(xml.attributes.parallaxy || "1"),
379
+ tintColor: xml.attributes.tintcolor,
380
+ locked: xml.attributes.locked === "1",
381
+ class: xml.attributes.class,
382
+ properties: this.parseXmlProperties(xml.children.find((c) => c.name === "properties"))
383
+ };
384
+ if (type === "tilelayer") {
385
+ layer.width = parseInt(xml.attributes.width || "0", 10);
386
+ layer.height = parseInt(xml.attributes.height || "0", 10);
387
+ const dataNode = xml.children.find((c) => c.name === "data");
388
+ if (dataNode) {
389
+ layer.encoding = dataNode.attributes.encoding;
390
+ layer.compression = dataNode.attributes.compression;
391
+ if (layer.encoding === "csv" || !layer.encoding) {
392
+ layer.data = dataNode.text.split(",").map((s) => parseInt(s.trim(), 10));
393
+ } else if (layer.encoding === "base64") {
394
+ this.addWarning(
395
+ "BASE64_DATA",
396
+ "Base64 encoded tile data requires decompression",
397
+ xml.attributes.name
398
+ );
399
+ }
400
+ const chunks = dataNode.children.filter((c) => c.name === "chunk");
401
+ if (chunks.length > 0) {
402
+ layer.chunks = chunks.map((c) => ({
403
+ x: parseInt(c.attributes.x || "0", 10),
404
+ y: parseInt(c.attributes.y || "0", 10),
405
+ width: parseInt(c.attributes.width || "0", 10),
406
+ height: parseInt(c.attributes.height || "0", 10),
407
+ data: c.text.split(",").map((s) => parseInt(s.trim(), 10))
408
+ }));
409
+ }
410
+ }
411
+ }
412
+ if (type === "objectgroup") {
413
+ layer.objects = xml.children.filter((c) => c.name === "object").map((o) => this.normalizeXmlObject(o));
414
+ layer.drawOrder = xml.attributes.draworder || "topdown";
415
+ layer.color = xml.attributes.color;
416
+ }
417
+ if (type === "imagelayer") {
418
+ const image = xml.children.find((c) => c.name === "image");
419
+ if (image) {
420
+ layer.image = image.attributes.source;
421
+ }
422
+ layer.repeatX = xml.attributes.repeatx === "1";
423
+ layer.repeatY = xml.attributes.repeaty === "1";
424
+ }
425
+ if (type === "group") {
426
+ layer.layers = [];
427
+ for (const child of xml.children) {
428
+ if (["layer", "objectgroup", "imagelayer", "group"].includes(child.name)) {
429
+ layer.layers.push(this.normalizeXmlLayer(child));
430
+ }
431
+ }
432
+ }
433
+ return layer;
434
+ }
435
+ normalizeXmlObject(xml) {
436
+ const obj = {
437
+ id: parseInt(xml.attributes.id || "0", 10),
438
+ name: xml.attributes.name || "",
439
+ type: xml.attributes.type || xml.attributes.class || "",
440
+ x: parseFloat(xml.attributes.x || "0"),
441
+ y: parseFloat(xml.attributes.y || "0"),
442
+ width: parseFloat(xml.attributes.width || "0"),
443
+ height: parseFloat(xml.attributes.height || "0"),
444
+ rotation: parseFloat(xml.attributes.rotation || "0"),
445
+ visible: xml.attributes.visible !== "0",
446
+ gid: xml.attributes.gid ? parseInt(xml.attributes.gid, 10) : void 0,
447
+ template: xml.attributes.template,
448
+ properties: this.parseXmlProperties(xml.children.find((c) => c.name === "properties"))
449
+ };
450
+ if (xml.children.some((c) => c.name === "point")) {
451
+ obj.point = true;
452
+ }
453
+ if (xml.children.some((c) => c.name === "ellipse")) {
454
+ obj.ellipse = true;
455
+ }
456
+ const polygon = xml.children.find((c) => c.name === "polygon");
457
+ if (polygon && polygon.attributes.points) {
458
+ obj.polygon = this.parsePoints(polygon.attributes.points);
459
+ }
460
+ const polyline = xml.children.find((c) => c.name === "polyline");
461
+ if (polyline && polyline.attributes.points) {
462
+ obj.polyline = this.parsePoints(polyline.attributes.points);
463
+ }
464
+ const text = xml.children.find((c) => c.name === "text");
465
+ if (text) {
466
+ obj.text = {
467
+ text: text.text || "",
468
+ fontFamily: text.attributes.fontfamily || "sans-serif",
469
+ pixelSize: parseInt(text.attributes.pixelsize || "16", 10),
470
+ wrap: text.attributes.wrap === "1",
471
+ color: text.attributes.color || "#000000",
472
+ bold: text.attributes.bold === "1",
473
+ italic: text.attributes.italic === "1",
474
+ underline: text.attributes.underline === "1",
475
+ strikeout: text.attributes.strikeout === "1",
476
+ kerning: text.attributes.kerning !== "0",
477
+ halign: text.attributes.halign || "left",
478
+ valign: text.attributes.valign || "top"
479
+ };
480
+ }
481
+ return obj;
482
+ }
483
+ parseXmlProperties(xml) {
484
+ if (!xml) {
485
+ return void 0;
486
+ }
487
+ return xml.children.filter((c) => c.name === "property").map((p) => ({
488
+ name: p.attributes.name || "",
489
+ type: p.attributes.type || "string",
490
+ value: this.parsePropertyValue(p.attributes.value || p.text, p.attributes.type),
491
+ propertyType: p.attributes.propertytype
492
+ }));
493
+ }
494
+ parsePropertyValue(value, type) {
495
+ switch (type) {
496
+ case "int":
497
+ return parseInt(value, 10);
498
+ case "float":
499
+ return parseFloat(value);
500
+ case "bool":
501
+ return value === "true";
502
+ default:
503
+ return value;
504
+ }
505
+ }
506
+ parsePoints(pointsStr) {
507
+ return pointsStr.split(" ").map((p) => {
508
+ const [x, y] = p.split(",").map((v) => parseFloat(v));
509
+ return { x, y };
510
+ });
511
+ }
512
+ getLayerType(xmlName) {
513
+ switch (xmlName) {
514
+ case "layer":
515
+ return "tilelayer";
516
+ case "objectgroup":
517
+ return "objectgroup";
518
+ case "imagelayer":
519
+ return "imagelayer";
520
+ case "group":
521
+ return "group";
522
+ default:
523
+ return "tilelayer";
524
+ }
525
+ }
526
+ async loadExternalTilesets(map, mapPath) {
527
+ const basePath = mapPath.substring(0, mapPath.lastIndexOf("/") + 1);
528
+ for (const tileset of map.tilesets) {
529
+ if (tileset.source) {
266
530
  try {
531
+ const tilesetPath = basePath + tileset.source;
532
+ const content = await this.readFile(tilesetPath);
533
+ const isJson = tileset.source.endsWith(".tsj") || tileset.source.endsWith(".json");
534
+ let externalTileset;
535
+ if (isJson) {
536
+ const json = JSON.parse(content);
537
+ externalTileset = this.normalizeJsonTileset(json);
538
+ } else {
267
539
  const xml = SceneImporter.parseXML(content);
268
- return this.normalizeXmlMap(xml);
269
- }
270
- catch (error) {
271
- this.addError('XML_PARSE_ERROR', `Failed to parse XML: ${error}`);
272
- return null;
273
- }
274
- }
275
- normalizeXmlMap(xml) {
276
- const map = {
277
- version: xml.attributes.version || '1.0',
278
- tiledVersion: xml.attributes.tiledversion || '',
279
- orientation: xml.attributes.orientation || 'orthogonal',
280
- renderOrder: xml.attributes.renderorder || 'right-down',
281
- width: parseInt(xml.attributes.width || '0', 10),
282
- height: parseInt(xml.attributes.height || '0', 10),
283
- tileWidth: parseInt(xml.attributes.tilewidth || '0', 10),
284
- tileHeight: parseInt(xml.attributes.tileheight || '0', 10),
285
- infinite: xml.attributes.infinite === '1',
286
- backgroundColor: xml.attributes.backgroundcolor,
287
- nextLayerId: parseInt(xml.attributes.nextlayerid || '0', 10),
288
- nextObjectId: parseInt(xml.attributes.nextobjectid || '0', 10),
289
- tilesets: [],
290
- layers: [],
291
- properties: this.parseXmlProperties(xml.children.find((c) => c.name === 'properties')),
292
- };
293
- // Parse tilesets
294
- for (const child of xml.children.filter((c) => c.name === 'tileset')) {
295
- map.tilesets.push(this.normalizeXmlTileset(child));
296
- }
297
- // Parse layers
298
- for (const child of xml.children) {
299
- if (['layer', 'objectgroup', 'imagelayer', 'group'].includes(child.name)) {
300
- map.layers.push(this.normalizeXmlLayer(child));
301
- }
302
- }
303
- return map;
304
- }
305
- normalizeXmlTileset(xml) {
306
- const tileset = {
307
- firstGid: parseInt(xml.attributes.firstgid || '0', 10),
308
- source: xml.attributes.source,
309
- name: xml.attributes.name || '',
310
- tileWidth: parseInt(xml.attributes.tilewidth || '0', 10),
311
- tileHeight: parseInt(xml.attributes.tileheight || '0', 10),
312
- spacing: parseInt(xml.attributes.spacing || '0', 10),
313
- margin: parseInt(xml.attributes.margin || '0', 10),
314
- tileCount: parseInt(xml.attributes.tilecount || '0', 10),
315
- columns: parseInt(xml.attributes.columns || '0', 10),
316
- properties: this.parseXmlProperties(xml.children.find((c) => c.name === 'properties')),
317
- };
318
- // Image
319
- const image = xml.children.find((c) => c.name === 'image');
320
- if (image) {
321
- tileset.image = image.attributes.source;
322
- tileset.imageWidth = parseInt(image.attributes.width || '0', 10);
323
- tileset.imageHeight = parseInt(image.attributes.height || '0', 10);
324
- tileset.transparentColor = image.attributes.trans;
325
- }
326
- // Tiles
327
- const tiles = xml.children.filter((c) => c.name === 'tile');
328
- if (tiles.length > 0) {
329
- tileset.tiles = tiles.map((t) => this.normalizeXmlTile(t));
330
- }
331
- // Tile offset
332
- const offset = xml.children.find((c) => c.name === 'tileoffset');
333
- if (offset) {
334
- tileset.tileOffset = {
335
- x: parseInt(offset.attributes.x || '0', 10),
336
- y: parseInt(offset.attributes.y || '0', 10),
337
- };
338
- }
339
- return tileset;
340
- }
341
- normalizeXmlTile(xml) {
342
- const tile = {
343
- id: parseInt(xml.attributes.id || '0', 10),
344
- type: xml.attributes.type,
345
- properties: this.parseXmlProperties(xml.children.find((c) => c.name === 'properties')),
346
- };
347
- // Animation
348
- const animation = xml.children.find((c) => c.name === 'animation');
349
- if (animation) {
350
- tile.animation = animation.children
351
- .filter((c) => c.name === 'frame')
352
- .map((f) => ({
353
- tileId: parseInt(f.attributes.tileid || '0', 10),
354
- duration: parseInt(f.attributes.duration || '0', 10),
355
- }));
356
- }
357
- // Collision (objectgroup)
358
- const objectGroup = xml.children.find((c) => c.name === 'objectgroup');
359
- if (objectGroup) {
360
- tile.objectGroup = {
361
- drawOrder: objectGroup.attributes.draworder || 'index',
362
- id: parseInt(objectGroup.attributes.id || '0', 10),
363
- name: objectGroup.attributes.name || '',
364
- objects: objectGroup.children
365
- .filter((c) => c.name === 'object')
366
- .map((o) => this.normalizeXmlObject(o)),
367
- };
368
- }
369
- return tile;
370
- }
371
- normalizeXmlLayer(xml) {
372
- const type = this.getLayerType(xml.name);
373
- const layer = {
374
- id: parseInt(xml.attributes.id || '0', 10),
375
- name: xml.attributes.name || '',
376
- type,
377
- visible: xml.attributes.visible !== '0',
378
- opacity: parseFloat(xml.attributes.opacity || '1'),
379
- offsetX: parseFloat(xml.attributes.offsetx || '0'),
380
- offsetY: parseFloat(xml.attributes.offsety || '0'),
381
- parallaxX: parseFloat(xml.attributes.parallaxx || '1'),
382
- parallaxY: parseFloat(xml.attributes.parallaxy || '1'),
383
- tintColor: xml.attributes.tintcolor,
384
- locked: xml.attributes.locked === '1',
385
- class: xml.attributes.class,
386
- properties: this.parseXmlProperties(xml.children.find((c) => c.name === 'properties')),
387
- };
388
- // Tile layer
389
- if (type === 'tilelayer') {
390
- layer.width = parseInt(xml.attributes.width || '0', 10);
391
- layer.height = parseInt(xml.attributes.height || '0', 10);
392
- const dataNode = xml.children.find((c) => c.name === 'data');
393
- if (dataNode) {
394
- layer.encoding = dataNode.attributes.encoding;
395
- layer.compression = dataNode.attributes.compression;
396
- if (layer.encoding === 'csv' || !layer.encoding) {
397
- // CSV data
398
- layer.data = dataNode.text.split(',').map((s) => parseInt(s.trim(), 10));
399
- }
400
- else if (layer.encoding === 'base64') {
401
- // Base64 encoded - would need decompression for gzip/zlib
402
- // For now, store as warning
403
- this.addWarning('BASE64_DATA', 'Base64 encoded tile data requires decompression', xml.attributes.name);
404
- }
405
- // Chunks for infinite maps
406
- const chunks = dataNode.children.filter((c) => c.name === 'chunk');
407
- if (chunks.length > 0) {
408
- layer.chunks = chunks.map((c) => ({
409
- x: parseInt(c.attributes.x || '0', 10),
410
- y: parseInt(c.attributes.y || '0', 10),
411
- width: parseInt(c.attributes.width || '0', 10),
412
- height: parseInt(c.attributes.height || '0', 10),
413
- data: c.text.split(',').map((s) => parseInt(s.trim(), 10)),
414
- }));
415
- }
416
- }
417
- }
418
- // Object layer
419
- if (type === 'objectgroup') {
420
- layer.objects = xml.children
421
- .filter((c) => c.name === 'object')
422
- .map((o) => this.normalizeXmlObject(o));
423
- layer.drawOrder = xml.attributes.draworder || 'topdown';
424
- layer.color = xml.attributes.color;
425
- }
426
- // Image layer
427
- if (type === 'imagelayer') {
428
- const image = xml.children.find((c) => c.name === 'image');
429
- if (image) {
430
- layer.image = image.attributes.source;
540
+ const tilesetNode = xml.name === "tileset" ? xml : xml.children.find((c) => c.name === "tileset");
541
+ if (tilesetNode) {
542
+ externalTileset = this.normalizeXmlTileset(tilesetNode);
543
+ } else {
544
+ continue;
431
545
  }
432
- layer.repeatX = xml.attributes.repeatx === '1';
433
- layer.repeatY = xml.attributes.repeaty === '1';
434
- }
435
- // Group layer
436
- if (type === 'group') {
437
- layer.layers = [];
438
- for (const child of xml.children) {
439
- if (['layer', 'objectgroup', 'imagelayer', 'group'].includes(child.name)) {
440
- layer.layers.push(this.normalizeXmlLayer(child));
441
- }
442
- }
443
- }
444
- return layer;
445
- }
446
- normalizeXmlObject(xml) {
447
- const obj = {
448
- id: parseInt(xml.attributes.id || '0', 10),
449
- name: xml.attributes.name || '',
450
- type: xml.attributes.type || xml.attributes.class || '',
451
- x: parseFloat(xml.attributes.x || '0'),
452
- y: parseFloat(xml.attributes.y || '0'),
453
- width: parseFloat(xml.attributes.width || '0'),
454
- height: parseFloat(xml.attributes.height || '0'),
455
- rotation: parseFloat(xml.attributes.rotation || '0'),
456
- visible: xml.attributes.visible !== '0',
457
- gid: xml.attributes.gid ? parseInt(xml.attributes.gid, 10) : undefined,
458
- template: xml.attributes.template,
459
- properties: this.parseXmlProperties(xml.children.find((c) => c.name === 'properties')),
460
- };
461
- // Point
462
- if (xml.children.some((c) => c.name === 'point')) {
463
- obj.point = true;
464
- }
465
- // Ellipse
466
- if (xml.children.some((c) => c.name === 'ellipse')) {
467
- obj.ellipse = true;
468
- }
469
- // Polygon
470
- const polygon = xml.children.find((c) => c.name === 'polygon');
471
- if (polygon && polygon.attributes.points) {
472
- obj.polygon = this.parsePoints(polygon.attributes.points);
473
- }
474
- // Polyline
475
- const polyline = xml.children.find((c) => c.name === 'polyline');
476
- if (polyline && polyline.attributes.points) {
477
- obj.polyline = this.parsePoints(polyline.attributes.points);
478
- }
479
- // Text
480
- const text = xml.children.find((c) => c.name === 'text');
481
- if (text) {
482
- obj.text = {
483
- text: text.text || '',
484
- fontFamily: text.attributes.fontfamily || 'sans-serif',
485
- pixelSize: parseInt(text.attributes.pixelsize || '16', 10),
486
- wrap: text.attributes.wrap === '1',
487
- color: text.attributes.color || '#000000',
488
- bold: text.attributes.bold === '1',
489
- italic: text.attributes.italic === '1',
490
- underline: text.attributes.underline === '1',
491
- strikeout: text.attributes.strikeout === '1',
492
- kerning: text.attributes.kerning !== '0',
493
- halign: text.attributes.halign || 'left',
494
- valign: text.attributes.valign || 'top',
495
- };
496
- }
497
- return obj;
498
- }
499
- parseXmlProperties(xml) {
500
- if (!xml) {
501
- return undefined;
502
- }
503
- return xml.children
504
- .filter((c) => c.name === 'property')
505
- .map((p) => ({
506
- name: p.attributes.name || '',
507
- type: p.attributes.type || 'string',
508
- value: this.parsePropertyValue(p.attributes.value || p.text, p.attributes.type),
509
- propertyType: p.attributes.propertytype,
510
- }));
511
- }
512
- parsePropertyValue(value, type) {
513
- switch (type) {
514
- case 'int':
515
- return parseInt(value, 10);
516
- case 'float':
517
- return parseFloat(value);
518
- case 'bool':
519
- return value === 'true';
520
- default:
521
- return value;
522
- }
523
- }
524
- parsePoints(pointsStr) {
525
- return pointsStr.split(' ').map((p) => {
526
- const [x, y] = p.split(',').map((v) => parseFloat(v));
527
- return { x, y };
528
- });
529
- }
530
- getLayerType(xmlName) {
531
- switch (xmlName) {
532
- case 'layer':
533
- return 'tilelayer';
534
- case 'objectgroup':
535
- return 'objectgroup';
536
- case 'imagelayer':
537
- return 'imagelayer';
538
- case 'group':
539
- return 'group';
540
- default:
541
- return 'tilelayer';
542
- }
543
- }
544
- async loadExternalTilesets(map, mapPath) {
545
- const basePath = mapPath.substring(0, mapPath.lastIndexOf('/') + 1);
546
- for (const tileset of map.tilesets) {
547
- if (tileset.source) {
548
- try {
549
- const tilesetPath = basePath + tileset.source;
550
- const content = await this.readFile(tilesetPath);
551
- const isJson = tileset.source.endsWith('.tsj') || tileset.source.endsWith('.json');
552
- let externalTileset;
553
- if (isJson) {
554
- const json = JSON.parse(content);
555
- externalTileset = this.normalizeJsonTileset(json);
556
- }
557
- else {
558
- const xml = SceneImporter.parseXML(content);
559
- const tilesetNode = xml.name === 'tileset' ? xml : xml.children.find((c) => c.name === 'tileset');
560
- if (tilesetNode) {
561
- externalTileset = this.normalizeXmlTileset(tilesetNode);
562
- }
563
- else {
564
- continue;
565
- }
566
- }
567
- // Merge external tileset data
568
- Object.assign(tileset, externalTileset, { firstGid: tileset.firstGid });
569
- }
570
- catch {
571
- this.addWarning('TILESET_LOAD_ERROR', `Failed to load external tileset: ${tileset.source}`, tileset.source);
572
- }
573
- }
574
- // Index tileset by first gid
575
- this.tilesets.set(tileset.name, tileset);
576
- this.tilesetsById.set(tileset.firstGid, tileset);
577
- }
578
- }
579
- // ----------------------------------------
580
- // Conversion
581
- // ----------------------------------------
582
- convertTiledMapToScene(map) {
583
- const layers = [];
584
- const entities = [];
585
- const zIndex = 0;
586
- this.processLayers(map.layers, layers, entities, zIndex);
587
- return {
588
- name: 'TiledMap',
589
- width: map.width * map.tileWidth,
590
- height: map.height * map.tileHeight,
591
- backgroundColor: map.backgroundColor || '#000000',
592
- layers,
593
- entities,
594
- properties: {
595
- orientation: map.orientation,
596
- renderOrder: map.renderOrder,
597
- tileWidth: map.tileWidth,
598
- tileHeight: map.tileHeight,
599
- infinite: map.infinite,
600
- ...this.convertProperties(map.properties),
601
- },
602
- };
603
- }
604
- processLayers(layers, outLayers, outEntities, zIndex) {
605
- for (const layer of layers) {
606
- if (layer.type === 'group' && layer.layers) {
607
- zIndex = this.processLayers(layer.layers, outLayers, outEntities, zIndex);
608
- }
609
- else {
610
- outLayers.push(this.convertLayer(layer, zIndex));
611
- // Extract objects as entities
612
- if (layer.type === 'objectgroup' && layer.objects) {
613
- for (const obj of layer.objects) {
614
- outEntities.push(this.convertObject(obj, layer.name, zIndex));
615
- }
616
- }
617
- zIndex++;
618
- }
619
- }
620
- return zIndex;
621
- }
622
- convertLayer(layer, zIndex) {
623
- const parsedLayer = {
624
- name: layer.name,
625
- type: this.mapLayerType(layer.type),
626
- visible: layer.visible,
627
- opacity: layer.opacity,
628
- offsetX: layer.offsetX,
629
- offsetY: layer.offsetY,
630
- parallaxX: layer.parallaxX,
631
- parallaxY: layer.parallaxY,
632
- zIndex,
633
- properties: this.convertProperties(layer.properties),
634
- };
635
- // Tile data
636
- if (layer.type === 'tilelayer' && layer.data) {
637
- parsedLayer.data = {
638
- width: layer.width || 0,
639
- height: layer.height || 0,
640
- tileWidth: 0, // Will be set from tileset
641
- tileHeight: 0,
642
- tiles: layer.data,
643
- };
644
- }
645
- return parsedLayer;
646
- }
647
- mapLayerType(type) {
648
- switch (type) {
649
- case 'tilelayer':
650
- return 'tile';
651
- case 'objectgroup':
652
- return 'object';
653
- case 'imagelayer':
654
- return 'image';
655
- case 'group':
656
- return 'group';
657
- default:
658
- return 'object';
659
- }
660
- }
661
- convertObject(obj, layerName, zIndex) {
662
- const components = [];
663
- // Determine shape type
664
- if (obj.polygon) {
665
- components.push({
666
- type: 'PolygonCollider',
667
- data: {
668
- points: obj.polygon,
669
- isTrigger: false,
670
- },
671
- });
672
- }
673
- else if (obj.polyline) {
674
- components.push({
675
- type: 'EdgeCollider',
676
- data: {
677
- points: obj.polyline,
678
- },
679
- });
680
- }
681
- else if (obj.ellipse) {
682
- components.push({
683
- type: 'CircleCollider',
684
- data: {
685
- radius: Math.max(obj.width, obj.height) / 2,
686
- isTrigger: false,
687
- },
688
- });
689
- }
690
- else if (obj.point) {
691
- components.push({
692
- type: 'Point',
693
- data: {},
694
- });
695
- }
696
- else if (obj.text) {
697
- components.push({
698
- type: 'Text',
699
- data: {
700
- text: obj.text.text,
701
- fontFamily: obj.text.fontFamily,
702
- fontSize: obj.text.pixelSize,
703
- color: obj.text.color,
704
- bold: obj.text.bold,
705
- italic: obj.text.italic,
706
- align: obj.text.halign,
707
- valign: obj.text.valign,
708
- wrap: obj.text.wrap,
709
- },
710
- });
711
- }
712
- else if (obj.gid) {
713
- // Tile object
714
- const tileset = this.findTilesetForGid(obj.gid);
715
- if (tileset) {
716
- const localId = obj.gid - tileset.firstGid;
717
- components.push({
718
- type: 'Sprite',
719
- data: {
720
- tileset: tileset.name,
721
- tileId: localId,
722
- width: obj.width,
723
- height: obj.height,
724
- },
725
- });
726
- }
727
- }
728
- else {
729
- // Rectangle
730
- components.push({
731
- type: 'BoxCollider',
732
- data: {
733
- width: obj.width,
734
- height: obj.height,
735
- isTrigger: false,
736
- },
737
- });
738
- }
739
- return {
740
- id: obj.id.toString(),
741
- name: obj.name || `Object_${obj.id}`,
742
- type: obj.type || 'TiledObject',
743
- x: obj.x,
744
- y: obj.y,
546
+ }
547
+ Object.assign(tileset, externalTileset, { firstGid: tileset.firstGid });
548
+ } catch {
549
+ this.addWarning(
550
+ "TILESET_LOAD_ERROR",
551
+ `Failed to load external tileset: ${tileset.source}`,
552
+ tileset.source
553
+ );
554
+ }
555
+ }
556
+ this.tilesets.set(tileset.name, tileset);
557
+ this.tilesetsById.set(tileset.firstGid, tileset);
558
+ }
559
+ }
560
+ // ----------------------------------------
561
+ // Conversion
562
+ // ----------------------------------------
563
+ convertTiledMapToScene(map) {
564
+ const layers = [];
565
+ const entities = [];
566
+ const zIndex = 0;
567
+ this.processLayers(map.layers, layers, entities, zIndex);
568
+ return {
569
+ name: "TiledMap",
570
+ width: map.width * map.tileWidth,
571
+ height: map.height * map.tileHeight,
572
+ backgroundColor: map.backgroundColor || "#000000",
573
+ layers,
574
+ entities,
575
+ properties: {
576
+ orientation: map.orientation,
577
+ renderOrder: map.renderOrder,
578
+ tileWidth: map.tileWidth,
579
+ tileHeight: map.tileHeight,
580
+ infinite: map.infinite,
581
+ ...this.convertProperties(map.properties)
582
+ }
583
+ };
584
+ }
585
+ processLayers(layers, outLayers, outEntities, zIndex) {
586
+ for (const layer of layers) {
587
+ if (layer.type === "group" && layer.layers) {
588
+ zIndex = this.processLayers(layer.layers, outLayers, outEntities, zIndex);
589
+ } else {
590
+ outLayers.push(this.convertLayer(layer, zIndex));
591
+ if (layer.type === "objectgroup" && layer.objects) {
592
+ for (const obj of layer.objects) {
593
+ outEntities.push(this.convertObject(obj, layer.name, zIndex));
594
+ }
595
+ }
596
+ zIndex++;
597
+ }
598
+ }
599
+ return zIndex;
600
+ }
601
+ convertLayer(layer, zIndex) {
602
+ const parsedLayer = {
603
+ name: layer.name,
604
+ type: this.mapLayerType(layer.type),
605
+ visible: layer.visible,
606
+ opacity: layer.opacity,
607
+ offsetX: layer.offsetX,
608
+ offsetY: layer.offsetY,
609
+ parallaxX: layer.parallaxX,
610
+ parallaxY: layer.parallaxY,
611
+ zIndex,
612
+ properties: this.convertProperties(layer.properties)
613
+ };
614
+ if (layer.type === "tilelayer" && layer.data) {
615
+ parsedLayer.data = {
616
+ width: layer.width || 0,
617
+ height: layer.height || 0,
618
+ tileWidth: 0,
619
+ // Will be set from tileset
620
+ tileHeight: 0,
621
+ tiles: layer.data
622
+ };
623
+ }
624
+ return parsedLayer;
625
+ }
626
+ mapLayerType(type) {
627
+ switch (type) {
628
+ case "tilelayer":
629
+ return "tile";
630
+ case "objectgroup":
631
+ return "object";
632
+ case "imagelayer":
633
+ return "image";
634
+ case "group":
635
+ return "group";
636
+ default:
637
+ return "object";
638
+ }
639
+ }
640
+ convertObject(obj, layerName, zIndex) {
641
+ const components = [];
642
+ if (obj.polygon) {
643
+ components.push({
644
+ type: "PolygonCollider",
645
+ data: {
646
+ points: obj.polygon,
647
+ isTrigger: false
648
+ }
649
+ });
650
+ } else if (obj.polyline) {
651
+ components.push({
652
+ type: "EdgeCollider",
653
+ data: {
654
+ points: obj.polyline
655
+ }
656
+ });
657
+ } else if (obj.ellipse) {
658
+ components.push({
659
+ type: "CircleCollider",
660
+ data: {
661
+ radius: Math.max(obj.width, obj.height) / 2,
662
+ isTrigger: false
663
+ }
664
+ });
665
+ } else if (obj.point) {
666
+ components.push({
667
+ type: "Point",
668
+ data: {}
669
+ });
670
+ } else if (obj.text) {
671
+ components.push({
672
+ type: "Text",
673
+ data: {
674
+ text: obj.text.text,
675
+ fontFamily: obj.text.fontFamily,
676
+ fontSize: obj.text.pixelSize,
677
+ color: obj.text.color,
678
+ bold: obj.text.bold,
679
+ italic: obj.text.italic,
680
+ align: obj.text.halign,
681
+ valign: obj.text.valign,
682
+ wrap: obj.text.wrap
683
+ }
684
+ });
685
+ } else if (obj.gid) {
686
+ const tileset = this.findTilesetForGid(obj.gid);
687
+ if (tileset) {
688
+ const localId = obj.gid - tileset.firstGid;
689
+ components.push({
690
+ type: "Sprite",
691
+ data: {
692
+ tileset: tileset.name,
693
+ tileId: localId,
745
694
  width: obj.width,
746
- height: obj.height,
747
- rotation: obj.rotation,
748
- scaleX: 1,
749
- scaleY: 1,
750
- visible: obj.visible,
751
- components,
752
- children: [],
753
- properties: {
754
- layer: layerName,
755
- zIndex,
756
- ...this.convertProperties(obj.properties),
757
- },
758
- };
759
- }
760
- findTilesetForGid(gid) {
761
- // Clear flip flags
762
- const tileId = gid & 0x0fffffff;
763
- let result = null;
764
- let maxFirstGid = 0;
765
- for (const [_, tileset] of this.tilesetsById) {
766
- if (tileset.firstGid <= tileId && tileset.firstGid > maxFirstGid) {
767
- maxFirstGid = tileset.firstGid;
768
- result = tileset;
769
- }
770
- }
771
- return result;
772
- }
773
- convertProperties(props) {
774
- if (!props) {
775
- return {};
776
- }
777
- const result = {};
778
- for (const prop of props) {
779
- result[prop.name] = prop.value;
780
- }
781
- return result;
782
- }
783
- extractAssets(map) {
784
- const assets = [];
785
- // Extract tileset images
786
- for (const tileset of map.tilesets) {
787
- if (tileset.image) {
788
- assets.push({
789
- id: this.generateId(),
790
- name: tileset.name,
791
- type: 'tileset',
792
- path: tileset.image,
793
- data: {
794
- tileWidth: tileset.tileWidth,
795
- tileHeight: tileset.tileHeight,
796
- tileCount: tileset.tileCount,
797
- columns: tileset.columns,
798
- margin: tileset.margin,
799
- spacing: tileset.spacing,
800
- firstGid: tileset.firstGid,
801
- tiles: tileset.tiles?.map((t) => ({
802
- id: t.id,
803
- type: t.type,
804
- animation: t.animation,
805
- collision: t.objectGroup?.objects,
806
- })),
807
- },
808
- });
809
- }
810
- }
811
- // Extract image layer images
812
- for (const layer of this.flattenLayers(map.layers)) {
813
- if (layer.type === 'imagelayer' && layer.image) {
814
- assets.push({
815
- id: this.generateId(),
816
- name: layer.name + '_image',
817
- type: 'texture',
818
- path: layer.image,
819
- data: {
820
- repeatX: layer.repeatX,
821
- repeatY: layer.repeatY,
822
- },
823
- });
824
- }
825
- }
826
- return assets;
827
- }
828
- flattenLayers(layers) {
829
- const result = [];
830
- for (const layer of layers) {
831
- result.push(layer);
832
- if (layer.type === 'group' && layer.layers) {
833
- result.push(...this.flattenLayers(layer.layers));
834
- }
835
- }
836
- return result;
837
- }
838
- // ----------------------------------------
839
- // Helper Methods
840
- // ----------------------------------------
841
- async readFile(path) {
842
- if (typeof globalThis.process !== 'undefined' && globalThis.process.versions?.node) {
843
- const fs = await import('fs');
844
- return fs.readFileSync(path, 'utf-8');
845
- }
846
- else if (typeof fetch !== 'undefined') {
847
- const response = await fetch(path);
848
- return response.text();
849
- }
850
- throw new Error('Unable to read file in current environment');
851
- }
695
+ height: obj.height
696
+ }
697
+ });
698
+ }
699
+ } else {
700
+ components.push({
701
+ type: "BoxCollider",
702
+ data: {
703
+ width: obj.width,
704
+ height: obj.height,
705
+ isTrigger: false
706
+ }
707
+ });
708
+ }
709
+ return {
710
+ id: obj.id.toString(),
711
+ name: obj.name || `Object_${obj.id}`,
712
+ type: obj.type || "TiledObject",
713
+ x: obj.x,
714
+ y: obj.y,
715
+ width: obj.width,
716
+ height: obj.height,
717
+ rotation: obj.rotation,
718
+ scaleX: 1,
719
+ scaleY: 1,
720
+ visible: obj.visible,
721
+ components,
722
+ children: [],
723
+ properties: {
724
+ layer: layerName,
725
+ zIndex,
726
+ ...this.convertProperties(obj.properties)
727
+ }
728
+ };
729
+ }
730
+ findTilesetForGid(gid) {
731
+ const tileId = gid & 268435455;
732
+ let result = null;
733
+ let maxFirstGid = 0;
734
+ for (const [_, tileset] of this.tilesetsById) {
735
+ if (tileset.firstGid <= tileId && tileset.firstGid > maxFirstGid) {
736
+ maxFirstGid = tileset.firstGid;
737
+ result = tileset;
738
+ }
739
+ }
740
+ return result;
741
+ }
742
+ convertProperties(props) {
743
+ if (!props) {
744
+ return {};
745
+ }
746
+ const result = {};
747
+ for (const prop of props) {
748
+ result[prop.name] = prop.value;
749
+ }
750
+ return result;
751
+ }
752
+ extractAssets(map) {
753
+ const assets = [];
754
+ for (const tileset of map.tilesets) {
755
+ if (tileset.image) {
756
+ assets.push({
757
+ id: this.generateId(),
758
+ name: tileset.name,
759
+ type: "tileset",
760
+ path: tileset.image,
761
+ data: {
762
+ tileWidth: tileset.tileWidth,
763
+ tileHeight: tileset.tileHeight,
764
+ tileCount: tileset.tileCount,
765
+ columns: tileset.columns,
766
+ margin: tileset.margin,
767
+ spacing: tileset.spacing,
768
+ firstGid: tileset.firstGid,
769
+ tiles: tileset.tiles?.map((t) => ({
770
+ id: t.id,
771
+ type: t.type,
772
+ animation: t.animation,
773
+ collision: t.objectGroup?.objects
774
+ }))
775
+ }
776
+ });
777
+ }
778
+ }
779
+ for (const layer of this.flattenLayers(map.layers)) {
780
+ if (layer.type === "imagelayer" && layer.image) {
781
+ assets.push({
782
+ id: this.generateId(),
783
+ name: layer.name + "_image",
784
+ type: "texture",
785
+ path: layer.image,
786
+ data: {
787
+ repeatX: layer.repeatX,
788
+ repeatY: layer.repeatY
789
+ }
790
+ });
791
+ }
792
+ }
793
+ return assets;
794
+ }
795
+ flattenLayers(layers) {
796
+ const result = [];
797
+ for (const layer of layers) {
798
+ result.push(layer);
799
+ if (layer.type === "group" && layer.layers) {
800
+ result.push(...this.flattenLayers(layer.layers));
801
+ }
802
+ }
803
+ return result;
804
+ }
805
+ // ----------------------------------------
806
+ // Helper Methods
807
+ // ----------------------------------------
808
+ async readFile(path) {
809
+ if (typeof globalThis.process !== "undefined" && globalThis.process.versions?.node) {
810
+ const fs = await import("fs");
811
+ return fs.readFileSync(path, "utf-8");
812
+ } else if (typeof fetch !== "undefined") {
813
+ const response = await fetch(path);
814
+ return response.text();
815
+ }
816
+ throw new Error("Unable to read file in current environment");
817
+ }
852
818
  }
853
-
854
819
  exports.TiledMapImporter = TiledMapImporter;