//获得提示 public string CalcHintStr() { var prop = CalcProb(); string addtionStr = ""; string positiveStr = GetPositiveStrJoin(); string negativeStr = GetNegativeStrJoin(); if (!positiveStr.IsInv()) { addtionStr = positiveStr + "\n"; } if (!negativeStr.IsInv()) { addtionStr += negativeStr + "\n"; } addtionStr = addtionStr.TrimEnd("\n"); return (Util.GetStr("Hint_DipProp", IsAgree ? Util.GetStr("Text_Dip_可能会") : Util.GetStr("Text_Dip_绝对不会"), UIUtil.Per(prop), UIUtil.ColSign(PositiveScore), UIUtil.ColSign(NegativeScore), UIUtil.ColSign(TotalScore), addtionStr)); // 拼接字符串 string GetStrJoin(IEnumerable <BaseDipPoint <TUnit, TWarData> > points) => string.Join("\n", points.Select(p => p.GetDesc()).ToArray()); // 获得正面效果 string GetPositiveStrJoin() => GetStrJoin(DipPoints.Where(p => p.Score > 0 || p.Score == 0 && p.IsShowWhenZero)); // 获得负面效果 string GetNegativeStrJoin() => GetStrJoin(DipPoints.Where(p => p.Score < 0)); }
public BaseNegotiationTemp(HashList <string> selfExcludeArticle, HashList <string> targetExcludeArticle, params BaseDipPoint <TUnit, TWarData>[] ps) { SelfExcludeArticle = selfExcludeArticle; TargetExcludeArticle = targetExcludeArticle; foreach (var item in ps) { DipPoints.Add(item); } DipPoints.Add(new DPArticle(1.0f)); }