feat: Introduce new services and refactor existing code for better structure

- Added ISpriteCacheService, IStaticDataService, and ITextService interfaces for improved service management.
- Implemented RunContracts for managing run states and node execution contexts.
- Created EnemyTagStatusRuntime to handle enemy status effects and their application.
- Refactored ShopPriceRuleService to utilize static data service for shop prices.
- Enhanced InventoryTowerEnduranceUtility to manage tower endurance reduction.
- Updated EventFormUseCase to work with new EventOptionExecutionContext.
- Removed unused dictionary loading code from ProcedurePreload.
- Cleaned up various utility classes and ensured consistent naming conventions.
- Updated tests to reflect changes in context and service usage.
This commit is contained in:
2026-05-13 22:18:47 +08:00
parent 9fc0ef2216
commit 7106e0adbe
45 changed files with 590 additions and 426 deletions
@@ -194,7 +194,7 @@ namespace GeometryTD.Tests.EditMode
new AddRandomCompsEffect(new AddRandomCompsParam(2, RarityType.Blue))
})
});
RunNodeExecutionContext context = CreateContext();
EventOptionExecutionContext context = CreateContext();
BackpackInventoryData firstInventory = new BackpackInventoryData();
BackpackInventoryData secondInventory = new BackpackInventoryData();
@@ -407,7 +407,7 @@ namespace GeometryTD.Tests.EditMode
BindingFlags.Instance | BindingFlags.NonPublic);
Assert.That(method, Is.Not.Null);
RunNodeExecutionContext context = CreateContext();
RunNodeExecutionContext context = CreateRunNodeContext();
EventItem first = (EventItem)method.Invoke(component, new object[] { context });
EventItem second = (EventItem)method.Invoke(component, new object[] { context });
@@ -437,7 +437,14 @@ namespace GeometryTD.Tests.EditMode
SetStaticInventoryGeneration(component);
}
private static RunNodeExecutionContext CreateContext()
private static EventOptionExecutionContext CreateContext()
{
return new EventOptionExecutionContext(
runSeed: 12345,
sequenceIndex: 3);
}
private static RunNodeExecutionContext CreateRunNodeContext()
{
return new RunNodeExecutionContext
{
@@ -10,7 +10,7 @@
"GeometryTD.Gameplay"
],
"includePlatforms": [
"Editor"
"Android"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
@@ -1,7 +1,5 @@
using System.Collections.Generic;
using System.Reflection;
using CustomComponent;
using GeometryTD.CustomComponent;
using GeometryTD.Core;
using GeometryTD.Factory;
using GeometryTD.Procedure;