58 lines
1.5 KiB
C#
58 lines
1.5 KiB
C#
using System.Collections.Generic;
|
||
|
||
namespace Models;
|
||
|
||
/// <summary>
|
||
/// 装备/设施定义(通用 + 学科专用)
|
||
/// 设计说明:
|
||
/// 1) Facility 与 Equipment 统一为 ItemDefinition,不同类别通过枚举区分。
|
||
/// 2) 效果使用 ModifierBundle + RuleIds 组合,便于特殊规则注入。
|
||
/// 注意事项:
|
||
/// - Placement/Slot 为 UI 与摆放系统提供约束,不做逻辑判断。
|
||
/// 未来扩展:
|
||
/// - 可加入“耐久度/维护成本/占地大小”等字段。
|
||
/// </summary>
|
||
public enum ItemCategory
|
||
{
|
||
Facility, // 设施
|
||
Equipment, // 装备
|
||
Consumable // 消耗品
|
||
}
|
||
|
||
public enum FacilityPlacement
|
||
{
|
||
Lab, // 实验室
|
||
ServerRoom, // 机房
|
||
Admin, // 行政区
|
||
Library, // 图书馆
|
||
RestArea, // 休息区
|
||
Field, // 场地
|
||
Global // 全局
|
||
}
|
||
|
||
public enum EquipmentSlot
|
||
{
|
||
Tool, // 工具
|
||
Accessory, // 饰品
|
||
Body, // 身体
|
||
Head, // 头部
|
||
Hand // 手部
|
||
}
|
||
|
||
public sealed class ItemDefinition
|
||
{
|
||
public DefinitionHeader Header { get; set; } = new();
|
||
public ItemCategory Category { get; set; }
|
||
public string DisciplineId { get; set; }
|
||
public FacilityPlacement Placement { get; set; }
|
||
public EquipmentSlot Slot { get; set; }
|
||
public ItemEffect Effect { get; set; } = new();
|
||
public bool IsUnique { get; set; }
|
||
public int MaxStack { get; set; } = 1;
|
||
}
|
||
|
||
public sealed class ItemEffect
|
||
{
|
||
public ModifierBundle Modifiers { get; set; } = new();
|
||
public List<string> RuleIds { get; } = new();
|
||
} |