5 层 UI 规范收敛 SelectRoleForm 的 RawData / Context
围绕规范 §3.2 / §3.4 / §8 整理 SelectRoleForm 的数据传输与展示模型,让两层各自只承担规范允许的职责,并把子组件归位到模块目录内。 RawData层: - RolePropertyAreaRawData 移除展示串 InitialPropertyText,改为业务字段 StatModifier[] InitialProperties,并补回 RoleId,避免 RawData 携带已格式化的展示文本(违反 §3.2)。 - SelectRoleRawData 拆掉平铺的 RoleIds / RoleIconNames 平行数组与 SelectedRoleId / SelectedRoleName / SelectedRoleInitialProperties 哨兵字段,聚合为 RoleItemRawData[] RoleItems 与 RolePropertyAreaRawData SelectedRole(null 表示未选中),跟 Context 端的子结构形态对称。 - SelectRoleUseCase.BuildModel 同步改造为构造子 RawData,不再处理 -1 哨兵 ID。 Context 层: - 删除 SelectRoleContext.RoleIds 冗余字段(信息已由 RoleItemContexts[i].RoleId 承载)。 - 新增 bool ShowRoleProperty,把"显示属性卡 vs 显示随机卡"从 RolePropertyAreaContext == null 的隐式哨兵改成显式信号;Form 端 UpdateShowRole 改为读 ShowRoleProperty 切换卡片,不再用 null 当三态信号。 - Controller.BuildContext 用 rawData.SelectedRole != null 取代 >= 0 判定,InitialPropertyText 仍由 Controller 通过 ItemDescUtility.CreatePropDescription 拼装后注入 Context。 目录归属 事件命名
This commit is contained in:
@@ -39,7 +39,7 @@ namespace SepCore.UI
|
||||
roleIndex++;
|
||||
}
|
||||
|
||||
UpdateShowRole(_context.RolePropertyAreaContext);
|
||||
UpdateShowRole(_context.ShowRoleProperty, _context.RolePropertyAreaContext);
|
||||
}
|
||||
|
||||
#region FSM
|
||||
@@ -76,9 +76,9 @@ namespace SepCore.UI
|
||||
|
||||
#endregion
|
||||
|
||||
public void UpdateShowRole(RolePropertyAreaContext propertyAreaContext)
|
||||
public void UpdateShowRole(bool showRoleProperty, RolePropertyAreaContext propertyAreaContext)
|
||||
{
|
||||
if (propertyAreaContext == null)
|
||||
if (!showRoleProperty)
|
||||
{
|
||||
_randomRoleCard.SetActive(true);
|
||||
_roleCard.SetActive(false);
|
||||
@@ -94,7 +94,7 @@ namespace SepCore.UI
|
||||
|
||||
public void OnReturnButtonClick()
|
||||
{
|
||||
GameEntry.Event.Fire(this, MenuSelectRoleReturnEventArgs.Create());
|
||||
GameEntry.Event.Fire(this, SelectRoleReturnEventArgs.Create());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user