using System.Collections.Generic; using FL.Network; using XGame.Framework.Data; using XGame.Framework.Network; namespace FL.Data { public class SummonService : DataSingleton { /// /// 百分比 /// /// /// public string GetProbability(float val) { return $"{(val * 100).ToString("F3")}%"; } public void RequestSummonInto() { NetModule.Request(new CallIntoRequest()); } public void RequestSummonSbOneDraw() { RequestSummonDraw(1, SummonData.Instance.SbInfo.OneDrawNum); } public void RequestSummonMwOneDraw() { RequestSummonDraw(2, SummonData.Instance.MwInfo.OneDrawNum); } public void RequestSummonSbTenDraw() { RequestSummonDraw(1, SummonData.Instance.SbInfo.TenDrawNum); } public void RequestSummonMwTenDraw() { RequestSummonDraw(2, SummonData.Instance.MwInfo.TenDrawNum); } private void RequestSummonDraw(int type, int count) { var param = new CallChoujiangRequest() { type = type, count = count }; (param as IMessage).Context = type; NetModule.Request(param); } public void RequestSummonSbAd() { var p = new List() { "act_call","1" }; PaymentService.Instance.ReqAdvert(p, EPayActionType.SummonSbAd); } public void RequestSummonMwAd() { var p = new List() { "act_call", "2" }; PaymentService.Instance.ReqAdvert(p, EPayActionType.SummonMwAd); } public void RequestSummonSbShare() { RequestSummonShare(1); } public void RequestSummonMwShare() { RequestSummonShare(2); } private void RequestSummonShare(int type) { var param = new CallShareRwdRequest() { type = type }; (param as IMessage).Context = type; NetModule.Request(param); } } }