feat: upgrade to ts2lua-unreal v0.3.0 and refactor Game classes to pure C++ callback + TS composition hot-reload

This commit is contained in:
szy73711 committed 2026-11-30 02:42:51 +08:00
1 parent 4ad4a8f36f
commit 783dccf53d
64 files changed
+2368 -714

No files matched your search

+56 -33
View File
@@ -1,37 +1,37 @@
local ____lualib = require("lualib_bundle")
local __TS__New = ____lualib.__TS__New
local ____exports = {}
local ____TestRunner = require("Tests.Harness.TestRunner")
local Suite = ____TestRunner.Suite
local Test = ____TestRunner.Test
local AssertEqual = ____TestRunner.AssertEqual
local AssertNear = ____TestRunner.AssertNear
local AssertTrue = ____TestRunner.AssertTrue
local AssertFalse = ____TestRunner.AssertFalse
local AssertNil = ____TestRunner.AssertNil
local AssertArrayEqual = ____TestRunner.AssertArrayEqual
local ____MockUnLuaRuntime = require("Tests.Harness.MockUnLuaRuntime")
local CreateBoundInstance = ____MockUnLuaRuntime.CreateBoundInstance
local ____FSM = require("Tests.Gameplay.FSM")
local StateMachine = ____FSM.StateMachine
local ____ObjectPool = require("Tests.Gameplay.ObjectPool")
local ObjectPool = ____ObjectPool.ObjectPool
local ____TimerScheduler = require("Tests.Gameplay.TimerScheduler")
local TimerScheduler = ____TimerScheduler.TimerScheduler
local CooldownTracker = ____TimerScheduler.CooldownTracker
local ____BuffAndAttributeSystem = require("Tests.Gameplay.BuffAndAttributeSystem")
local AttributeAndBuffComponent = ____BuffAndAttributeSystem.AttributeAndBuffComponent
local ____InventorySystem = require("Tests.Gameplay.InventorySystem")
local InventorySystem = ____InventorySystem.InventorySystem
local ____CoroutineTaskRunner = require("Tests.Gameplay.CoroutineTaskRunner")
local CoroutineTaskRunner = ____CoroutineTaskRunner.CoroutineTaskRunner
local ____BehaviorTree = require("Tests.Gameplay.BehaviorTree")
local BTAction = ____BehaviorTree.BTAction
local BTCondition = ____BehaviorTree.BTCondition
local BTCooldown = ____BehaviorTree.BTCooldown
local BTInverter = ____BehaviorTree.BTInverter
local BTSelector = ____BehaviorTree.BTSelector
local BTSequence = ____BehaviorTree.BTSequence
local ____exports = __module.env
local M__Tests_Harness_TestRunner = __MODULE__.Import("Tests.Harness.TestRunner", __module)
local Suite = M__Tests_Harness_TestRunner.Suite
local Test = M__Tests_Harness_TestRunner.Test
local AssertEqual = M__Tests_Harness_TestRunner.AssertEqual
local AssertNear = M__Tests_Harness_TestRunner.AssertNear
local AssertTrue = M__Tests_Harness_TestRunner.AssertTrue
local AssertFalse = M__Tests_Harness_TestRunner.AssertFalse
local AssertNil = M__Tests_Harness_TestRunner.AssertNil
local AssertArrayEqual = M__Tests_Harness_TestRunner.AssertArrayEqual
local M__Tests_Harness_MockUnLuaRuntime = __MODULE__.Import("Tests.Harness.MockUnLuaRuntime", __module)
local CreateBoundInstance = M__Tests_Harness_MockUnLuaRuntime.CreateBoundInstance
local M__Tests_Gameplay_FSM = __MODULE__.Import("Tests.Gameplay.FSM", __module)
local StateMachine = M__Tests_Gameplay_FSM.StateMachine
local M__Tests_Gameplay_ObjectPool = __MODULE__.Import("Tests.Gameplay.ObjectPool", __module)
local ObjectPool = M__Tests_Gameplay_ObjectPool.ObjectPool
local M__Tests_Gameplay_TimerScheduler = __MODULE__.Import("Tests.Gameplay.TimerScheduler", __module)
local TimerScheduler = M__Tests_Gameplay_TimerScheduler.TimerScheduler
local CooldownTracker = M__Tests_Gameplay_TimerScheduler.CooldownTracker
local M__Tests_Gameplay_BuffAndAttributeSystem = __MODULE__.Import("Tests.Gameplay.BuffAndAttributeSystem", __module)
local AttributeAndBuffComponent = M__Tests_Gameplay_BuffAndAttributeSystem.AttributeAndBuffComponent
local M__Tests_Gameplay_InventorySystem = __MODULE__.Import("Tests.Gameplay.InventorySystem", __module)
local InventorySystem = M__Tests_Gameplay_InventorySystem.InventorySystem
local M__Tests_Gameplay_CoroutineTaskRunner = __MODULE__.Import("Tests.Gameplay.CoroutineTaskRunner", __module)
local CoroutineTaskRunner = M__Tests_Gameplay_CoroutineTaskRunner.CoroutineTaskRunner
local M__Tests_Gameplay_BehaviorTree = __MODULE__.Import("Tests.Gameplay.BehaviorTree", __module)
local BTAction = M__Tests_Gameplay_BehaviorTree.BTAction
local BTCondition = M__Tests_Gameplay_BehaviorTree.BTCondition
local BTCooldown = M__Tests_Gameplay_BehaviorTree.BTCooldown
local BTInverter = M__Tests_Gameplay_BehaviorTree.BTInverter
local BTSelector = M__Tests_Gameplay_BehaviorTree.BTSelector
local BTSequence = M__Tests_Gameplay_BehaviorTree.BTSequence
function ____exports.RunGameplayTests()
Suite(
"Gameplay.Systems",
@@ -489,4 +489,27 @@ function ____exports.RunGameplayTests()
end
)
end
return ____exports
function __module.UpdateImports()
Suite = M__Tests_Harness_TestRunner.Suite
Test = M__Tests_Harness_TestRunner.Test
AssertEqual = M__Tests_Harness_TestRunner.AssertEqual
AssertNear = M__Tests_Harness_TestRunner.AssertNear
AssertTrue = M__Tests_Harness_TestRunner.AssertTrue
AssertFalse = M__Tests_Harness_TestRunner.AssertFalse
AssertNil = M__Tests_Harness_TestRunner.AssertNil
AssertArrayEqual = M__Tests_Harness_TestRunner.AssertArrayEqual
CreateBoundInstance = M__Tests_Harness_MockUnLuaRuntime.CreateBoundInstance
StateMachine = M__Tests_Gameplay_FSM.StateMachine
ObjectPool = M__Tests_Gameplay_ObjectPool.ObjectPool
TimerScheduler = M__Tests_Gameplay_TimerScheduler.TimerScheduler
CooldownTracker = M__Tests_Gameplay_TimerScheduler.CooldownTracker
AttributeAndBuffComponent = M__Tests_Gameplay_BuffAndAttributeSystem.AttributeAndBuffComponent
InventorySystem = M__Tests_Gameplay_InventorySystem.InventorySystem
CoroutineTaskRunner = M__Tests_Gameplay_CoroutineTaskRunner.CoroutineTaskRunner
BTAction = M__Tests_Gameplay_BehaviorTree.BTAction
BTCondition = M__Tests_Gameplay_BehaviorTree.BTCondition
BTCooldown = M__Tests_Gameplay_BehaviorTree.BTCooldown
BTInverter = M__Tests_Gameplay_BehaviorTree.BTInverter
BTSelector = M__Tests_Gameplay_BehaviorTree.BTSelector
BTSequence = M__Tests_Gameplay_BehaviorTree.BTSequence
end