/// <summary> /// Enters all entrants of this lottery into the given lottery /// </summary> public void CombineInto(ILottery <T> lottery) { foreach (var e in entrantBlocks.Keys) { lottery.Enter(e, entrantBlocks[e].TotalSize); } }
/// <summary> /// Writes the data of the provided <see cref="ILottery"/> to the <see cref="StringBuilder"/> /// </summary> /// <param name="lottery">The <see cref="ILottery"/> whose data is to be written</param> /// <returns>A <see cref="StringBuilder"/> containing string representation of the provided lottery</returns> private StringBuilder WriteLotteryData(ILottery lottery) { Guard.Argument(lottery, nameof(lottery)).NotNull(); var builder = new StringBuilder(); AddEntityData(lottery, builder); var sportId = _taskProcessor.GetTaskResult(lottery.GetSportIdAsync()); var sport = _taskProcessor.GetTaskResult(lottery.GetSportAsync()); var category = _taskProcessor.GetTaskResult(lottery.GetCategoryAsync()); var tournamentCoverage = _taskProcessor.GetTaskResult(lottery.GetTournamentCoverage()); var bonusInfo = _taskProcessor.GetTaskResult(lottery.GetBonusInfoAsync()); var drawInfo = _taskProcessor.GetTaskResult(lottery.GetDrawInfoAsync()); var draws = _taskProcessor.GetTaskResult(lottery.GetScheduledDrawsAsync()); var drawsString = draws == null ? "null" : string.Join(",", draws.Select(s => s)); builder.Append(" SportId=").Append(sportId) .Append(" Sport=").Append(sport) .Append(" Category=").Append(category) .Append(" TournamentCoverage=").Append(tournamentCoverage?.LiveCoverage) .Append(" BonusInfo=").Append(bonusInfo) .Append(" DrawInfo=").Append(drawInfo) .Append(" Draws=[").Append(drawsString).Append("]"); return(builder); }
/// <summary> /// Returns a combined lottery between this lottery and the given lottery /// </summary> /// <param name="lottery"></param> /// <returns></returns> public ILottery <T> CombineWith(ILottery <T> lottery) { Lottery <T> result = new Lottery <T>(); lottery.CombineInto(result); this.CombineInto(result); return(result); }
public FixedMaster( ILottery gameLottery, ILottery mediaLottery) { _gameLottery = gameLottery; _mediaLottery = mediaLottery; LoadRegularBookings(); LoadOnceOffBookings(); }
public DrawController( ILottery lottery, IDrawRepository drawRepository, IBallotRepository ballotRepository) { _lottery = lottery; _drawRepository = drawRepository; _ballotRepository = ballotRepository; }
public ShopController(ILottery lottery, ICustomerRepository customerRepository, IDrawRepository drawRepository, IBallotRepository ballotRepository) { _lottery = lottery; _customerRepository = customerRepository; _drawRepository = drawRepository; _ballotRepository = ballotRepository; }
public List <string> Save(ILottery newLottery) { List <string> message = new List <string>(); ICollection <ValidationResult> validationResults = null; bool isValid = Validator.TryValidateObject(newLottery, new ValidationContext(newLottery), validationResults, true); if (isValid) { lotteryTable.Add(newLottery); } else { message = validationResults .Select(x => x.ErrorMessage) .ToList(); } return(message); }
/// /// <param name="pLotteryType"></param> /// <param name="pLottery"></param> public static List<WinDetail> GetWinResult(LotteryType pLotteryType, ILottery pLottery) { return null; }
public GameList( ILottery gameLottery) { Lottery = gameLottery; }
/// /// <param name="pLottery"></param> public List<WinDetail> GetWinDetails(ILottery pLottery) { return null; }
public void Add(ILottery item) { Add(item, item.Weight()); }
/// <summary> /// 抽選を行う /// </summary> public static bool Lottery(this ILottery self, float addRate = 0.0f) { return((self.WinningRate + (self.WinningRate * addRate)).Lottery()); }
public App(ILottery generator) { _generator = generator ?? throw new ArgumentNullException(nameof(generator)); }