补全 S1 测试

- 调整 CombatNode 正常结束与异常的变量语义,现在是 DidCombatWin 与 Exception
- 补充测试样例
- 完成 S1 目标
This commit is contained in:
SepComet
2026-03-08 21:10:03 +08:00
parent 1023239880
commit 793a87c171
29 changed files with 393 additions and 113 deletions
@@ -1,21 +0,0 @@
using GameFramework;
using GameFramework.Event;
namespace GeometryTD.CustomEvent
{
public class CombatFailureReturnEventArgs : GameEventArgs
{
public static int EventId => typeof(CombatFailureReturnEventArgs).GetHashCode();
public override int Id => EventId;
public static CombatFailureReturnEventArgs Create()
{
return ReferencePool.Acquire<CombatFailureReturnEventArgs>();
}
public override void Clear()
{
}
}
}
@@ -1,3 +0,0 @@
fileFormatVersion: 2
guid: 7db1bf4f6f5f435d8d3086510e178d1d
timeCreated: 1772863200
@@ -20,7 +20,9 @@ namespace GeometryTD.CustomEvent
public int SequenceIndex { get; private set; }
public bool Succeeded { get; private set; }
public RunNodeCompletionStatus CompletionStatus { get; private set; }
public bool CombatWon { get; private set; }
public BackpackInventoryData InventorySnapshotAfterNode { get; private set; }
@@ -30,7 +32,7 @@ namespace GeometryTD.CustomEvent
public static NodeCompleteEventArgs Create()
{
return Create(null, 0, RunNodeType.None, -1, true, null);
return Create(null, 0, RunNodeType.None, -1, RunNodeCompletionStatus.Completed, true, null);
}
public static NodeCompleteEventArgs Create(
@@ -38,7 +40,8 @@ namespace GeometryTD.CustomEvent
int nodeId,
RunNodeType nodeType,
int sequenceIndex,
bool succeeded,
RunNodeCompletionStatus completionStatus,
bool combatWon,
BackpackInventoryData inventorySnapshotAfterNode)
{
var args = ReferencePool.Acquire<NodeCompleteEventArgs>();
@@ -46,7 +49,8 @@ namespace GeometryTD.CustomEvent
args.NodeId = nodeId;
args.NodeType = nodeType;
args.SequenceIndex = sequenceIndex;
args.Succeeded = succeeded;
args.CompletionStatus = completionStatus;
args.CombatWon = combatWon;
args.InventorySnapshotAfterNode = InventoryCloneUtility.CloneInventory(inventorySnapshotAfterNode);
return args;
@@ -58,7 +62,8 @@ namespace GeometryTD.CustomEvent
NodeId = 0;
NodeType = RunNodeType.None;
SequenceIndex = -1;
Succeeded = false;
CompletionStatus = RunNodeCompletionStatus.None;
CombatWon = false;
InventorySnapshotAfterNode = null;
}
}