private static void SendResult(MsgInformationEx MsgDTO, DiceResultModel ResultModel) { var sum = ResultModel.Result.Sum(p => p); var sb = string.Join("+", ResultModel.Result.Select(p => p.ToString())); if (ResultModel.Modify != 0) { sum += ResultModel.Modify; sb += $"+{ResultModel.Modify}"; } sb += $"={sum}"; MsgSender.PushMsg(MsgDTO, sb, true); }
private static DiceResultModel ConsoleDice(DiceModel model) { var result = new DiceResultModel { Modify = model.Modify, Result = new List <int>() }; for (var i = 0; i < model.Count; i++) { var value = Rander.RandInt(model.Size) + 1; result.Result.Add(value); } return(result); }