using System.Collections; using System.Collections.Generic; using UnityEngine; /// /// 物品类型 /// public enum ItemType { 材料, 装备 } /// /// 物品 - 数据 /// public class DataItem { /// 物品名称 public string name; /// 物品类型 public ItemType itemType; } /// /// 材料 - 数据 /// public class DataMaterial : DataItem { /// 物品数量 public int quantity; /// 堆叠上限 public int maxStack; } /// /// 穿戴类型 /// public enum WearType { 武器, 护甲, 头盔, 手套, 鞋子, } /// /// 穿戴 - 数据 /// public class DataWear : DataItem { /// 装备类型 public WearType wearType; /// 附加列表 public List additions = new List(); /// 附加效果 public virtual DataAddition Addition => EquipmentTool.Merge(additions); } /// /// 武器类型。 /// public enum WeaponType { 无, 轻型武器, 中型武器, 重型武器, 盾牌, } /// /// 武器 - 数据 /// public class DataWeapon : DataWear { /// 武器类型 public WeaponType weaponType; /// 伤害骰子 public DataDamageDice damageDice; } /// /// 伤害类型 /// public enum DamageType { 无, 穿刺, 挥砍, 钝击 } /// /// 伤害骰子 - 数据 /// public class DataDamageDice { /// 伤害骰子 public readonly int value; /// 伤害类型 public readonly DamageType type; public DataDamageDice(int value, DamageType type) { this.value = value; this.type = type; } } /// /// 护甲类型。 /// public enum ArmorType { 布甲, 轻甲, 中甲, 重甲, } /// /// 护甲 - 数据 /// public class DataArmor : DataWear { /// 护甲类型 public ArmorType armorType; }