/// <summary> /// 吸收来自其他单元的属性 /// </summary> /// <param name="fromCell">来源及cell</param> public void Plus([NotNull] TheFiveProperties fromCell) { // 获取目标值到当前cell中 // 混合本地值 NoneValue += fromCell.NoneValue; FireValue += fromCell.FireValue; WaterValue += fromCell.WaterValue; MetalValue += fromCell.MetalValue; WoodValue += fromCell.WoodValue; EarthValue += fromCell.EarthValue; // 如果五属性都有则将其转化为无属性 var min = Utils.MinValue(FireValue, WaterValue, MetalValue, WoodValue, EarthValue); if (min > 0) { NoneValue += min; FireValue -= min; WaterValue -= min; MetalValue -= min; WoodValue -= min; EarthValue -= min; } LinkCount += fromCell.LinkCount; }
/// <summary> /// 向外传输 /// </summary> /// <returns>输出自己</returns> public TheFiveProperties Export() { TheFiveProperties result = null; if (ExoprtCount > 1) { // 分裂 result = (properties + additionProperties) / ExoprtCount; } else { result = (properties + additionProperties); } return(result); }
/// <summary> /// 清理属性数据 /// </summary> public void ClearProperties() { // 清空数据 additionProperties = new TheFiveProperties(); }