diff --git a/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs b/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs index e805f32..fb8c800 100644 --- a/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs +++ b/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs @@ -24,6 +24,8 @@ public partial class GameEntry public static SpriteCacheComponent SpriteCache { get; private set; } + public static InventoryGenerationComponent InventoryGeneration { get; private set; } + private static void InitCustomComponents() { BuiltinData = UnityGameFramework.Runtime.GameEntry.GetComponent(); @@ -35,5 +37,6 @@ public partial class GameEntry ShopNode = UnityGameFramework.Runtime.GameEntry.GetComponent(); ResolutionAdapter = UnityGameFramework.Runtime.GameEntry.GetComponent(); SpriteCache = UnityGameFramework.Runtime.GameEntry.GetComponent(); + InventoryGeneration = UnityGameFramework.Runtime.GameEntry.GetComponent(); } -} \ No newline at end of file +} diff --git a/Assets/GameMain/Scripts/CustomComponent/CombatNode/CombatScheduler/CombatStates/CombatWaitingForPhaseEndState.cs b/Assets/GameMain/Scripts/CustomComponent/CombatNode/CombatScheduler/CombatStates/CombatWaitingForPhaseEndState.cs index 8a82d9f..440fcc0 100644 --- a/Assets/GameMain/Scripts/CustomComponent/CombatNode/CombatScheduler/CombatStates/CombatWaitingForPhaseEndState.cs +++ b/Assets/GameMain/Scripts/CustomComponent/CombatNode/CombatScheduler/CombatStates/CombatWaitingForPhaseEndState.cs @@ -1,4 +1,5 @@ using GeometryTD.DataTable; +using GeometryTD.Factory; namespace GeometryTD.CustomComponent { diff --git a/Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs b/Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs index 2d3c8e9..9c4641a 100644 --- a/Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs +++ b/Assets/GameMain/Scripts/CustomComponent/EventNodeComponent.cs @@ -3,6 +3,7 @@ using GameFramework.DataTable; using GeometryTD.CustomEvent; using GeometryTD.DataTable; using GeometryTD.Definition; +using GeometryTD.Factory; using GeometryTD.Procedure; using Newtonsoft.Json.Linq; using GeometryTD.UI; diff --git a/Assets/GameMain/Scripts/CustomComponent/InventoryGeneration.meta b/Assets/GameMain/Scripts/CustomComponent/InventoryGeneration.meta new file mode 100644 index 0000000..0d83040 --- /dev/null +++ b/Assets/GameMain/Scripts/CustomComponent/InventoryGeneration.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3d606503b1c28cf4983b8b44abbf14f7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/CustomComponent/InventoryGeneration/InventoryGenerationComponent.cs b/Assets/GameMain/Scripts/CustomComponent/InventoryGeneration/InventoryGenerationComponent.cs new file mode 100644 index 0000000..d9ecdc7 --- /dev/null +++ b/Assets/GameMain/Scripts/CustomComponent/InventoryGeneration/InventoryGenerationComponent.cs @@ -0,0 +1,218 @@ +using System; +using System.Collections.Generic; +using GameFramework.DataTable; +using GeometryTD.CustomUtility; +using GeometryTD.DataTable; +using GeometryTD.Definition; +using GeometryTD.Factory; +using GeometryTD.UI; +using UnityEngine; +using UnityGameFramework.Runtime; + +namespace GeometryTD.CustomComponent +{ + public sealed class InventoryGenerationComponent : GameFrameworkComponent + { + private long _nextTempInstanceId = 1000000; + + private readonly List _shopPriceRows = new(); + private IDataTable _shopPriceTable; + private IDataTable _muzzleCompTable; + private IDataTable _bearingCompTable; + private IDataTable _baseCompTable; + + public List BuildShopGoods(int goodsCount, int runSeed = 0, int sequenceIndex = -1) + { + if (goodsCount <= 0) + { + return new List(); + } + + EnsureShopTables(); + + List goodsItems = new(goodsCount); + for (int i = 0; i < goodsCount; i++) + { + goodsItems.Add(BuildShopGoodsItem(i, runSeed, sequenceIndex)); + } + + return goodsItems; + } + + public EnemyDropResult ResolveEnemyDrop(in EnemyDropContext context) + { + throw new NotImplementedException( + "InventoryGenerationComponent.ResolveEnemyDrop() will be implemented in G2."); + } + + public IReadOnlyList BuildRewardCandidates( + int displayPhaseIndex, + LevelThemeType themeType, + int candidateCount) + { + throw new NotImplementedException( + "InventoryGenerationComponent.BuildRewardCandidates() will be implemented in G2."); + } + + private void EnsureShopTables() + { + _shopPriceTable ??= GameEntry.DataTable.GetDataTable(); + _muzzleCompTable ??= GameEntry.DataTable.GetDataTable(); + _bearingCompTable ??= GameEntry.DataTable.GetDataTable(); + _baseCompTable ??= GameEntry.DataTable.GetDataTable(); + + if (_shopPriceTable == null || _muzzleCompTable == null || _bearingCompTable == null || + _baseCompTable == null) + { + throw new InvalidOperationException( + "InventoryGenerationComponent requires ShopPrice, MuzzleComp, BearingComp, and BaseComp data tables."); + } + + if (_shopPriceRows.Count > 0) + { + return; + } + + DRShopPrice[] rows = _shopPriceTable.GetAllDataRows(); + if (rows == null || rows.Length <= 0) + { + throw new InvalidOperationException( + "InventoryGenerationComponent requires at least one shop price row."); + } + + foreach (var row in rows) + { + if (row != null) + { + _shopPriceRows.Add(row); + } + } + + if (_shopPriceRows.Count <= 0) + { + throw new InvalidOperationException("InventoryGenerationComponent requires non-null shop price rows."); + } + } + + private GoodsItemRawData BuildShopGoodsItem(int goodsIndex, int runSeed, int sequenceIndex) + { + TowerCompItemData sourceItem = BuildRandomComponentItem(goodsIndex, runSeed, sequenceIndex); + return new GoodsItemRawData + { + GoodsIndex = goodsIndex, + Title = sourceItem.Name, + TypeText = BuildTypeText(sourceItem.SlotType), + Description = BuildDescription(sourceItem), + Price = ResolveRandomPrice(sourceItem.Rarity), + Tags = sourceItem.Tags != null ? (TagType[])sourceItem.Tags.Clone() : Array.Empty(), + IconAreaContext = BuildIconAreaContext(sourceItem), + SourceItem = sourceItem, + IsPurchased = false + }; + } + + private TowerCompItemData BuildRandomComponentItem(int goodsIndex, int runSeed, int sequenceIndex) + { + int slotRoll = UnityEngine.Random.Range(0, 3); + DRShopPrice priceRow = _shopPriceRows[UnityEngine.Random.Range(0, _shopPriceRows.Count)]; + RarityType rarity = InventoryRarityRuleService.NormalizeComponentRarity( + priceRow != null ? priceRow.Rarity : RarityType.White); + + return slotRoll switch + { + 0 => BuildRandomMuzzleItem(rarity, goodsIndex, runSeed, sequenceIndex), + 1 => BuildRandomBearingItem(rarity, goodsIndex, runSeed, sequenceIndex), + _ => BuildRandomBaseItem(rarity, goodsIndex, runSeed, sequenceIndex) + }; + } + + private MuzzleCompItemData BuildRandomMuzzleItem(RarityType rarity, int goodsIndex, int runSeed, + int sequenceIndex) + { + DRMuzzleComp[] rows = _muzzleCompTable.GetAllDataRows(); + DRMuzzleComp config = rows[UnityEngine.Random.Range(0, rows.Length)]; + long instanceId = _nextTempInstanceId++; + InventoryTagRandomContext randomContext = + InventoryTagRandomContext.CreateShop(runSeed, sequenceIndex, goodsIndex, config.Id); + return ComponentItemFactory.CreateMuzzle(config, instanceId, rarity, randomContext); + } + + private BearingCompItemData BuildRandomBearingItem(RarityType rarity, int goodsIndex, int runSeed, + int sequenceIndex) + { + DRBearingComp[] rows = _bearingCompTable.GetAllDataRows(); + DRBearingComp config = rows[UnityEngine.Random.Range(0, rows.Length)]; + long instanceId = _nextTempInstanceId++; + InventoryTagRandomContext randomContext = + InventoryTagRandomContext.CreateShop(runSeed, sequenceIndex, goodsIndex, config.Id); + return ComponentItemFactory.CreateBearing(config, instanceId, rarity, randomContext); + } + + private BaseCompItemData BuildRandomBaseItem(RarityType rarity, int goodsIndex, int runSeed, int sequenceIndex) + { + DRBaseComp[] rows = _baseCompTable.GetAllDataRows(); + DRBaseComp config = rows[UnityEngine.Random.Range(0, rows.Length)]; + long instanceId = _nextTempInstanceId++; + InventoryTagRandomContext randomContext = + InventoryTagRandomContext.CreateShop(runSeed, sequenceIndex, goodsIndex, config.Id); + return ComponentItemFactory.CreateBase(config, instanceId, rarity, randomContext); + } + + private int ResolveRandomPrice(RarityType rarity) + { + for (int i = 0; i < _shopPriceRows.Count; i++) + { + DRShopPrice row = _shopPriceRows[i]; + if (row != null && row.Rarity == rarity) + { + int min = Mathf.Max(0, row.MinPrice); + int max = Mathf.Max(min, row.MaxPrice); + return UnityEngine.Random.Range(min, max + 1); + } + } + + return 0; + } + + private static IconAreaContext BuildIconAreaContext(TowerCompItemData item) + { + return new IconAreaContext + { + Rarity = item.Rarity, + ComponentSlotType = item.SlotType, + Color = IconColorGenerator.GenerateForComponent(item) + }; + } + + private static string BuildTypeText(TowerCompSlotType slotType) + { + return slotType switch + { + TowerCompSlotType.Muzzle => "枪口组件", + TowerCompSlotType.Bearing => "轴承组件", + TowerCompSlotType.Base => "底座组件", + _ => "组件" + }; + } + + private static string BuildDescription(TowerCompItemData item) + { + if (item is MuzzleCompItemData muzzleComp) + { + return ItemDescUtility.BuildMuzzleDesc(muzzleComp); + } + + if (item is BearingCompItemData bearingComp) + { + return ItemDescUtility.BuildBearingDesc(bearingComp); + } + + if (item is BaseCompItemData baseComp) + { + return ItemDescUtility.BuildBaseDesc(baseComp); + } + + return string.Empty; + } + } +} diff --git a/Assets/GameMain/Scripts/CustomComponent/InventoryGeneration/InventoryGenerationComponent.cs.meta b/Assets/GameMain/Scripts/CustomComponent/InventoryGeneration/InventoryGenerationComponent.cs.meta new file mode 100644 index 0000000..d81981c --- /dev/null +++ b/Assets/GameMain/Scripts/CustomComponent/InventoryGeneration/InventoryGenerationComponent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a41477f01c335444a26223742e2a9b3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/Factory.meta b/Assets/GameMain/Scripts/Factory.meta new file mode 100644 index 0000000..557e8dd --- /dev/null +++ b/Assets/GameMain/Scripts/Factory.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bcacad8280fb40ff88961b131604e5e4 +timeCreated: 1773292400 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Factory/ComponentItemFactory.cs b/Assets/GameMain/Scripts/Factory/ComponentItemFactory.cs new file mode 100644 index 0000000..2519701 --- /dev/null +++ b/Assets/GameMain/Scripts/Factory/ComponentItemFactory.cs @@ -0,0 +1,82 @@ +using System; +using GeometryTD.DataTable; +using GeometryTD.Definition; + +namespace GeometryTD.Factory +{ + public static class ComponentItemFactory + { + public static MuzzleCompItemData CreateMuzzle( + DRMuzzleComp config, + long instanceId, + RarityType rarity, + InventoryTagRandomContext randomContext) + { + RarityType normalizedRarity = InventoryRarityRuleService.NormalizeComponentRarity(rarity); + return new MuzzleCompItemData + { + InstanceId = instanceId, + ConfigId = config.Id, + Name = config.Name, + Rarity = normalizedRarity, + Endurance = 100f, + Constraint = config.Constraint, + Tags = ComponentTagGenerationService.ResolveComponentTags( + config.PossibleTag, + normalizedRarity, + randomContext), + AttackDamage = config.AttackDamage != null ? (int[])config.AttackDamage.Clone() : Array.Empty(), + DamageRandomRate = config.DamageRandomRate, + AttackMethodType = config.AttackMethodType + }; + } + + public static BearingCompItemData CreateBearing( + DRBearingComp config, + long instanceId, + RarityType rarity, + InventoryTagRandomContext randomContext) + { + RarityType normalizedRarity = InventoryRarityRuleService.NormalizeComponentRarity(rarity); + return new BearingCompItemData + { + InstanceId = instanceId, + ConfigId = config.Id, + Name = config.Name, + Rarity = normalizedRarity, + Endurance = 100f, + Constraint = config.Constraint, + Tags = ComponentTagGenerationService.ResolveComponentTags( + config.PossibleTag, + normalizedRarity, + randomContext), + RotateSpeed = config.RotateSpeed != null ? (float[])config.RotateSpeed.Clone() : Array.Empty(), + AttackRange = config.AttackRange != null ? (float[])config.AttackRange.Clone() : Array.Empty() + }; + } + + public static BaseCompItemData CreateBase( + DRBaseComp config, + long instanceId, + RarityType rarity, + InventoryTagRandomContext randomContext) + { + RarityType normalizedRarity = InventoryRarityRuleService.NormalizeComponentRarity(rarity); + return new BaseCompItemData + { + InstanceId = instanceId, + ConfigId = config.Id, + Name = config.Name, + Rarity = normalizedRarity, + Endurance = 100f, + Constraint = config.Constraint, + Tags = ComponentTagGenerationService.ResolveComponentTags( + config.PossibleTag, + normalizedRarity, + randomContext), + AttackSpeed = config.AttackSpeed != null ? (float[])config.AttackSpeed.Clone() : Array.Empty(), + AttackPropertyType = config.AttackPropertyType + }; + } + } +} diff --git a/Assets/GameMain/Scripts/Factory/ComponentItemFactory.cs.meta b/Assets/GameMain/Scripts/Factory/ComponentItemFactory.cs.meta new file mode 100644 index 0000000..0d427be --- /dev/null +++ b/Assets/GameMain/Scripts/Factory/ComponentItemFactory.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: bf4dd23294965e945bdda9496e0278e9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/Definition/EventEffectFactory.cs b/Assets/GameMain/Scripts/Factory/EventEffectFactory.cs similarity index 97% rename from Assets/GameMain/Scripts/Definition/EventEffectFactory.cs rename to Assets/GameMain/Scripts/Factory/EventEffectFactory.cs index 5f116c3..f1a7017 100644 --- a/Assets/GameMain/Scripts/Definition/EventEffectFactory.cs +++ b/Assets/GameMain/Scripts/Factory/EventEffectFactory.cs @@ -1,8 +1,9 @@ using GeometryTD.CustomUtility; +using GeometryTD.Definition; using Newtonsoft.Json.Linq; using UnityGameFramework.Runtime; -namespace GeometryTD.Definition +namespace GeometryTD.Factory { public static class EventEffectFactory { diff --git a/Assets/GameMain/Scripts/Definition/EventEffectFactory.cs.meta b/Assets/GameMain/Scripts/Factory/EventEffectFactory.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/Definition/EventEffectFactory.cs.meta rename to Assets/GameMain/Scripts/Factory/EventEffectFactory.cs.meta diff --git a/Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs b/Assets/GameMain/Scripts/Factory/EventRequirementFactory.cs similarity index 97% rename from Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs rename to Assets/GameMain/Scripts/Factory/EventRequirementFactory.cs index cbfdb01..d5ec065 100644 --- a/Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs +++ b/Assets/GameMain/Scripts/Factory/EventRequirementFactory.cs @@ -1,8 +1,9 @@ using GeometryTD.CustomUtility; +using GeometryTD.Definition; using Newtonsoft.Json.Linq; using UnityGameFramework.Runtime; -namespace GeometryTD.Definition +namespace GeometryTD.Factory { public static class EventRequirementFactory { diff --git a/Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs.meta b/Assets/GameMain/Scripts/Factory/EventRequirementFactory.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/Definition/EventRequirementFactory.cs.meta rename to Assets/GameMain/Scripts/Factory/EventRequirementFactory.cs.meta diff --git a/Assets/GameMain/Scripts/CustomComponent/CombatNode/CombatScheduler/PhaseEndConditions/PhaseEndConditionFactory.cs b/Assets/GameMain/Scripts/Factory/PhaseEndConditionFactory.cs similarity index 93% rename from Assets/GameMain/Scripts/CustomComponent/CombatNode/CombatScheduler/PhaseEndConditions/PhaseEndConditionFactory.cs rename to Assets/GameMain/Scripts/Factory/PhaseEndConditionFactory.cs index 1690324..f3aaab5 100644 --- a/Assets/GameMain/Scripts/CustomComponent/CombatNode/CombatScheduler/PhaseEndConditions/PhaseEndConditionFactory.cs +++ b/Assets/GameMain/Scripts/Factory/PhaseEndConditionFactory.cs @@ -1,6 +1,7 @@ +using GeometryTD.CustomComponent; using GeometryTD.Definition; -namespace GeometryTD.CustomComponent +namespace GeometryTD.Factory { internal static class PhaseEndConditionFactory { diff --git a/Assets/GameMain/Scripts/CustomComponent/CombatNode/CombatScheduler/PhaseEndConditions/PhaseEndConditionFactory.cs.meta b/Assets/GameMain/Scripts/Factory/PhaseEndConditionFactory.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/CustomComponent/CombatNode/CombatScheduler/PhaseEndConditions/PhaseEndConditionFactory.cs.meta rename to Assets/GameMain/Scripts/Factory/PhaseEndConditionFactory.cs.meta diff --git a/Assets/GameMain/Scripts/Procedure/ProcedureMain/RunStateFactory.cs b/Assets/GameMain/Scripts/Factory/RunStateFactory.cs similarity index 97% rename from Assets/GameMain/Scripts/Procedure/ProcedureMain/RunStateFactory.cs rename to Assets/GameMain/Scripts/Factory/RunStateFactory.cs index 8e49820..d945aeb 100644 --- a/Assets/GameMain/Scripts/Procedure/ProcedureMain/RunStateFactory.cs +++ b/Assets/GameMain/Scripts/Factory/RunStateFactory.cs @@ -1,7 +1,8 @@ using System.Collections.Generic; using GeometryTD.Definition; +using GeometryTD.Procedure; -namespace GeometryTD.Procedure +namespace GeometryTD.Factory { public static class RunStateFactory { @@ -55,4 +56,4 @@ namespace GeometryTD.Procedure return seed == 0 ? 1 : seed; } } -} +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Procedure/ProcedureMain/RunStateFactory.cs.meta b/Assets/GameMain/Scripts/Factory/RunStateFactory.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/Procedure/ProcedureMain/RunStateFactory.cs.meta rename to Assets/GameMain/Scripts/Factory/RunStateFactory.cs.meta diff --git a/Assets/GameMain/Scripts/Procedure/ProcedureMain/ProcedureMain.cs b/Assets/GameMain/Scripts/Procedure/ProcedureMain/ProcedureMain.cs index 17656b4..58ec36e 100644 --- a/Assets/GameMain/Scripts/Procedure/ProcedureMain/ProcedureMain.cs +++ b/Assets/GameMain/Scripts/Procedure/ProcedureMain/ProcedureMain.cs @@ -5,6 +5,7 @@ using System; using GeometryTD.CustomEvent; using GeometryTD.CustomUtility; using GeometryTD.Definition; +using GeometryTD.Factory; using GeometryTD.UI; using UnityGameFramework.Runtime; diff --git a/Assets/GameMain/Scripts/Procedure/ProcedureMain/RunModel.cs b/Assets/GameMain/Scripts/Procedure/ProcedureMain/RunModel.cs index 7faa522..f053d51 100644 --- a/Assets/GameMain/Scripts/Procedure/ProcedureMain/RunModel.cs +++ b/Assets/GameMain/Scripts/Procedure/ProcedureMain/RunModel.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using GeometryTD.CustomUtility; using GeometryTD.Definition; +using GeometryTD.Factory; namespace GeometryTD.Procedure { diff --git a/Assets/Launcher.unity b/Assets/Launcher.unity index 7db504e..f63cbba 100644 --- a/Assets/Launcher.unity +++ b/Assets/Launcher.unity @@ -157,6 +157,7 @@ Transform: - {fileID: 428539048} - {fileID: 1322505022} - {fileID: 1062564689} + - {fileID: 1554147129} m_Father: {fileID: 1852670053} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &120093239 @@ -1134,6 +1135,50 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5e646500b9304d438746f2351c71a0f4, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1 &1554147128 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1554147129} + - component: {fileID: 1554147130} + m_Layer: 0 + m_Name: InventoryGeneration + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1554147129 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1554147128} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 119167776} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1554147130 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1554147128} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5a41477f01c335444a26223742e2a9b3, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &1576232202 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Tests/EditMode/ProcedureMainFlowTests.cs b/Assets/Tests/EditMode/ProcedureMainFlowTests.cs index 4468b1c..bc0a1bd 100644 --- a/Assets/Tests/EditMode/ProcedureMainFlowTests.cs +++ b/Assets/Tests/EditMode/ProcedureMainFlowTests.cs @@ -4,6 +4,7 @@ using CustomComponent; using GeometryTD.CustomComponent; using GeometryTD.CustomEvent; using GeometryTD.Definition; +using GeometryTD.Factory; using GeometryTD.Procedure; using GeometryTD.UI; using NUnit.Framework; diff --git a/Assets/Tests/EditMode/ProcedureMainServicesTests.cs b/Assets/Tests/EditMode/ProcedureMainServicesTests.cs index 2dc651a..d1f7c9a 100644 --- a/Assets/Tests/EditMode/ProcedureMainServicesTests.cs +++ b/Assets/Tests/EditMode/ProcedureMainServicesTests.cs @@ -1,4 +1,5 @@ using GeometryTD.Definition; +using GeometryTD.Factory; using GeometryTD.Procedure; using GeometryTD.UI; using NUnit.Framework; diff --git a/Assets/Tests/EditMode/RunStateTests.cs b/Assets/Tests/EditMode/RunStateTests.cs index b3dc8ad..080643a 100644 --- a/Assets/Tests/EditMode/RunStateTests.cs +++ b/Assets/Tests/EditMode/RunStateTests.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using GeometryTD.CustomEvent; using GeometryTD.Definition; +using GeometryTD.Factory; using GeometryTD.Procedure; using NUnit.Framework; diff --git a/docs/CodeX-TODO.md b/docs/CodeX-TODO.md index 34a729d..9c88ac8 100644 --- a/docs/CodeX-TODO.md +++ b/docs/CodeX-TODO.md @@ -109,12 +109,12 @@ ## 阶段 G1 - 收口组件产出入口 -| 状态 | ID | 任务 | 目标 | -|---|---|---|---| +| 状态 | ID | 任务 | 目标 | +|-----|-------|-----------------------------------|------------| | [ ] | G1-01 | 新增 `InventoryGenerationComponent` | 建立统一组件产出入口 | -| [ ] | G1-02 | 新增 `ComponentItemFactory` | 收口组件实例构造 | -| [ ] | G1-03 | 新增 `ShopGoodsBuilder` | 收口商店货物生成 | -| [ ] | G1-04 | 让 `ShopFormUseCase` 改用组件入口 | 商店不再自己生成组件 | +| [ ] | G1-02 | 新增 `ComponentItemFactory` | 收口组件实例构造 | +| [ ] | G1-03 | 新增 `ShopGoodsBuilder` | 收口商店货物生成 | +| [ ] | G1-04 | 让 `ShopFormUseCase` 改用组件入口 | 商店不再自己生成组件 | ### G1 验收标准 @@ -124,12 +124,12 @@ ## 阶段 G2 - 收口战斗掉落与奖励候选 -| 状态 | ID | 任务 | 目标 | -|---|---|---|---| -| [ ] | G2-01 | 新增 `DropPoolRoller` | 收口掉落池与稀有度抽样 | -| [ ] | G2-02 | 新增 `RewardCandidateBuilder` | 收口 3 选 1 候选生成 | -| [ ] | G2-03 | 让战斗掉落改走 `InventoryGenerationComponent` | 战斗不再自己构造组件 | -| [ ] | G2-04 | 让满血奖励候选改走统一入口 | 掉落与奖励候选共用产出体系 | +| 状态 | ID | 任务 | 目标 | +|-----|-------|----------------------------------------|---------------| +| [ ] | G2-01 | 新增 `DropPoolRoller` | 收口掉落池与稀有度抽样 | +| [ ] | G2-02 | 新增 `RewardCandidateBuilder` | 收口 3 选 1 候选生成 | +| [ ] | G2-03 | 让战斗掉落改走 `InventoryGenerationComponent` | 战斗不再自己构造组件 | +| [ ] | G2-04 | 让满血奖励候选改走统一入口 | 掉落与奖励候选共用产出体系 | ### G2 验收标准 @@ -139,12 +139,12 @@ ## 阶段 G3 - 收口结算模块边界 -| 状态 | ID | 任务 | 目标 | -|---|---|---|---| -| [ ] | G3-01 | 新增 `CombatSettlementCalculator` | 只保留结算计算 | -| [ ] | G3-02 | 新增 `CombatSettlementCommitter` | 只保留库存提交 | -| [ ] | G3-03 | 精简 `CombatSettlementService` | 只剩流程编排 | -| [ ] | G3-04 | 清理奖励 RawData 重复映射 | 候选生成与 UI 组装边界清晰 | +| 状态 | ID | 任务 | 目标 | +|-----|-------|---------------------------------|-----------------| +| [ ] | G3-01 | 新增 `CombatSettlementCalculator` | 只保留结算计算 | +| [ ] | G3-02 | 新增 `CombatSettlementCommitter` | 只保留库存提交 | +| [ ] | G3-03 | 精简 `CombatSettlementService` | 只剩流程编排 | +| [ ] | G3-04 | 清理奖励 RawData 重复映射 | 候选生成与 UI 组装边界清晰 | ### G3 验收标准 @@ -154,11 +154,11 @@ ## 阶段 G4 - 收口 Tag 初始化入口 -| 状态 | ID | 任务 | 目标 | -|---|---|---|---| -| [ ] | G4-01 | 新增 `TagRegistryComponent` | 建立 Tag 运行时入口 | +| 状态 | ID | 任务 | 目标 | +|-----|-------|----------------------------------|--------------------| +| [ ] | G4-01 | 新增 `TagRegistryComponent` | 建立 Tag 运行时入口 | | [ ] | G4-02 | 挪出 `ProcedurePreload` 中 Tag 注册逻辑 | 流程代码不再直接维护 Tag 注册表 | -| [ ] | G4-03 | 对齐 Tag 加载时机与重载入口 | 初始化路径明确 | +| [ ] | G4-03 | 对齐 Tag 加载时机与重载入口 | 初始化路径明确 | ### G4 验收标准 @@ -168,11 +168,11 @@ ## 阶段 G5 - 收口随机合同 -| 状态 | ID | 任务 | 目标 | -|---|---|---|---| -| [ ] | G5-01 | 统一商店 / 掉落 / 奖励候选的随机上下文 | 全部产出链路使用一致合同 | -| [ ] | G5-02 | 补齐整体产出的 `runSeed` 稳定性 | 不只稳定 Tag,也稳定物品产出 | -| [ ] | G5-03 | 增加对应 EditMode 测试 | 同 Run 可复现,跨 Run 可区分 | +| 状态 | ID | 任务 | 目标 | +|-----|-------|------------------------|---------------------| +| [ ] | G5-01 | 统一商店 / 掉落 / 奖励候选的随机上下文 | 全部产出链路使用一致合同 | +| [ ] | G5-02 | 补齐整体产出的 `runSeed` 稳定性 | 不只稳定 Tag,也稳定物品产出 | +| [ ] | G5-03 | 增加对应 EditMode 测试 | 同 Run 可复现,跨 Run 可区分 | ### G5 验收标准