/// <summary> /// Initializes a new instance of the <see cref="SportDataProvider"/> class /// </summary> /// <param name="sportEntityFactory">A <see cref="ISportEntityFactory"/> used to construct <see cref="ITournament"/> instances</param> /// <param name="sportEventCache">A <see cref="ISportEventCache"/> used to retrieve schedules for sport events</param> /// <param name="sportEventStatusCache">A <see cref="ISportEventStatusCache"/> used to retrieve status for sport event</param> /// <param name="profileCache">A <see cref="IProfileCache"/> used to retrieve competitor or player profile</param> /// <param name="sportDataCache">A <see cref="ISportDataCache"/> used to retrieve sport data</param> /// <param name="defaultCultures"> A <see cref="IList{CultureInfo}"/> specified as default cultures (from configuration)</param> /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> enum member specifying enum member specifying how instances provided by the current provider will handle exceptions</param> /// <param name="cacheManager">A <see cref="ICacheManager"/> used to interact among caches</param> /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve match statuses</param> /// <param name="dataRouterManager">A <see cref="IDataRouterManager"/> used to invoke API requests</param> public SportDataProvider(ISportEntityFactory sportEntityFactory, ISportEventCache sportEventCache, ISportEventStatusCache sportEventStatusCache, IProfileCache profileCache, ISportDataCache sportDataCache, IEnumerable <CultureInfo> defaultCultures, ExceptionHandlingStrategy exceptionStrategy, ICacheManager cacheManager, ILocalizedNamedValueCache matchStatusCache, IDataRouterManager dataRouterManager) { Guard.Argument(sportEntityFactory, nameof(sportEntityFactory)).NotNull(); Guard.Argument(sportEventCache, nameof(sportEventCache)).NotNull(); Guard.Argument(profileCache, nameof(profileCache)).NotNull(); Guard.Argument(defaultCultures, nameof(defaultCultures)).NotNull().NotEmpty(); Guard.Argument(cacheManager, nameof(cacheManager)).NotNull(); Guard.Argument(matchStatusCache, nameof(matchStatusCache)).NotNull(); Guard.Argument(dataRouterManager, nameof(dataRouterManager)).NotNull(); _sportEntityFactory = sportEntityFactory; _sportEventCache = sportEventCache; _sportEventStatusCache = sportEventStatusCache; _profileCache = profileCache; _sportDataCache = sportDataCache; _defaultCultures = defaultCultures as IReadOnlyCollection <CultureInfo>; _exceptionStrategy = exceptionStrategy; _cacheManager = cacheManager; _matchStatusCache = matchStatusCache; _dataRouterManager = dataRouterManager; }
/// <summary> /// Initializes a new instance of the <see cref="SportDataProvider"/> class /// </summary> /// <param name="sportEntityFactory">A <see cref="ISportEntityFactory"/> used to construct <see cref="ITournament"/> instances</param> /// <param name="sportEventCache">A <see cref="ISportEventCache"/> used to retrieve schedules for sport events</param> /// <param name="sportEventStatusCache">A <see cref="ISportEventStatusCache"/> used to retrieve status for sport event</param> /// <param name="profileCache">A <see cref="IProfileCache"/> ued to retrieve competitor or player profile</param> /// <param name="defaultCultures"> A <see cref="IList{CultureInfo}"/> specified as default cultures (from configuration)</param> /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> enum member specifying enum member specifying how instances provided by the current provider will handle exceptions</param> /// <param name="cacheManager">A <see cref="ICacheManager"/> used to interact among caches</param> /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve match statuses</param> public SportDataProvider(ISportEntityFactory sportEntityFactory, ISportEventCache sportEventCache, ISportEventStatusCache sportEventStatusCache, IProfileCache profileCache, IEnumerable <CultureInfo> defaultCultures, ExceptionHandlingStrategy exceptionStrategy, ICacheManager cacheManager, ILocalizedNamedValueCache matchStatusCache, IDataRouterManager dataRouterManager) { Contract.Requires(sportEntityFactory != null); Contract.Requires(sportEventCache != null); Contract.Requires(profileCache != null); Contract.Requires(defaultCultures != null); Contract.Requires(defaultCultures.Any()); Contract.Requires(cacheManager != null); Contract.Requires(matchStatusCache != null); Contract.Requires(dataRouterManager != null); _sportEntityFactory = sportEntityFactory; _sportEventCache = sportEventCache; _sportEventStatusCache = sportEventStatusCache; _profileCache = profileCache; _defaultCultures = defaultCultures as IReadOnlyCollection <CultureInfo>; _exceptionStrategy = exceptionStrategy; _cacheManager = cacheManager; _matchStatusCache = matchStatusCache; _dataRouterManager = dataRouterManager; }
internal EventResult(EventResultDTO dto, ILocalizedNamedValueCache matchStatusesCache) { _matchStatusesCache = matchStatusesCache; Id = dto.Id; Position = dto.Position; Points = dto.Points; PointsDecimal = dto.PointsDecimal; WcPoints = dto.WcPoints; Time = dto.Time; TimeRanking = dto.TimeRanking; Status = dto.Status; StatusComment = dto.StatusComment; Sprint = dto.Sprint; SprintDecimal = dto.SprintDecimal; SprintRanking = dto.SprintRanking; Climber = dto.Climber; ClimberDecimal = dto.ClimberDecimal; ClimberRanking = dto.ClimberRanking; _matchStatusCode = dto.MatchStatus; HomeScore = dto.HomeScore; AwayScore = dto.AwayScore; Grid = dto.Grid; Distance = dto.Distance; CompetitorResults = dto.CompetitorResults?.Select(s => new CompetitorResult(s)); }
/// <summary> /// Initializes a new instance of the <see cref="SportEventStatus"/> class. /// </summary> /// <param name="cacheItem">A <see cref="SportEventStatusCI"/> containing information about sport event status, which will be used to initialize a new instance</param> /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve event status</param> public SportEventStatus(SportEventStatusCI cacheItem, ILocalizedNamedValueCache matchStatusCache) { Contract.Requires(cacheItem != null); Contract.Requires(matchStatusCache != null); _cacheItem = cacheItem; _matchStatusCache = matchStatusCache; }
/// <summary> /// Initializes a new instance of the <see cref="SportEventStatus"/> class /// </summary> /// <param name="cacheItem">A <see cref="SportEventStatusCI"/> containing information about sport event status, which will be used to initialize a new instance</param> /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve event status</param> public SportEventStatus(SportEventStatusCI cacheItem, ILocalizedNamedValueCache matchStatusCache) { Guard.Argument(cacheItem, nameof(cacheItem)).NotNull(); Guard.Argument(matchStatusCache, nameof(matchStatusCache)).NotNull(); _cacheItem = cacheItem; _matchStatusCache = matchStatusCache; }
public SoccerStatus(SportEventStatusCI ci, ILocalizedNamedValueCache matchStatusesCache) : base(ci, matchStatusesCache) { if (ci?.SportEventStatistics != null) { Statistics = new SoccerStatistics(ci.SportEventStatistics.TotalStatisticsDTOs, ci.SportEventStatistics.PeriodStatisticsDTOs); } }
/// <summary> /// Initializes a new instance of the <see cref="PeriodScore" /> class. /// </summary> /// <param name="dto">The data-transfer-object for period score</param> /// <param name="matchStatusesCache">The match statuses cache</param> public PeriodScore(PeriodScoreDTO dto, ILocalizedNamedValueCache matchStatusesCache) { Contract.Requires(dto != null); _homeScore = dto.HomeScore; _awayScore = dto.AwayScore; _type = dto.Type; _number = dto.PeriodNumber; MatchStatusCode = dto.MatchStatusCode; _matchStatusesCache = matchStatusesCache; }
/// <summary> /// Initializes a new instance of the <see cref="PeriodScore"/> class. /// </summary> /// <param name="dto">The data-transfer-object for period score</param> /// <param name="matchStatusesCache">The match statuses cache</param> public PeriodScore(PeriodScoreDTO dto, ILocalizedNamedValueCache matchStatusesCache) { Guard.Argument(dto, nameof(dto)).NotNull(); _homeScore = dto.HomeScore; _awayScore = dto.AwayScore; _type = dto.Type; _number = dto.PeriodNumber; _matchStatusCode = dto.MatchStatusCode; _matchStatusesCache = matchStatusesCache; }
public SoccerEvent(URN id, URN sportId, ISportEntityFactory sportEntityFactory, ISportEventCache sportEventCache, ISportEventStatusCache sportEventStatusCache, ILocalizedNamedValueCache matchStatusCache, IEnumerable <CultureInfo> cultures, ExceptionHandlingStrategy exceptionStrategy) : base(id, sportId, sportEntityFactory, sportEventCache, sportEventStatusCache, matchStatusCache, cultures, exceptionStrategy) { }
/// <summary> /// Initializes a new instance of the <see cref="NamedValuesProvider"/> class. /// </summary> /// <param name="voidReasons">The <see cref="INamedValueCache" /> providing void reason descriptions.</param> /// <param name="betStopReasons">The <see cref="INamedValueCache" /> providing bet stop reason descriptions.</param> /// <param name="bettingStatuses">The <see cref="INamedValueCache" /> providing betting status descriptions.</param> /// <param name="matchStatuses">The <see cref="ILocalizedNamedValueCache" /> providing localized(translatable) match status descriptions.</param> public NamedValuesProvider(INamedValueCache voidReasons, INamedValueCache betStopReasons, INamedValueCache bettingStatuses, ILocalizedNamedValueCache matchStatuses) { Contract.Requires(voidReasons != null); Contract.Requires(betStopReasons != null); Contract.Requires(bettingStatuses != null); Contract.Requires(matchStatuses != null); VoidReasons = voidReasons; BetStopReasons = betStopReasons; BettingStatuses = bettingStatuses; MatchStatuses = matchStatuses; }
/// <summary> /// Initializes a new instance of the <see cref="NamedValuesProvider"/> class. /// </summary> /// <param name="voidReasons">The <see cref="INamedValueCache" /> providing void reason descriptions.</param> /// <param name="betStopReasons">The <see cref="INamedValueCache" /> providing bet stop reason descriptions.</param> /// <param name="bettingStatuses">The <see cref="INamedValueCache" /> providing betting status descriptions.</param> /// <param name="matchStatuses">The <see cref="ILocalizedNamedValueCache" /> providing localized(translatable) match status descriptions.</param> public NamedValuesProvider(INamedValueCache voidReasons, INamedValueCache betStopReasons, INamedValueCache bettingStatuses, ILocalizedNamedValueCache matchStatuses) { Guard.Argument(voidReasons, nameof(voidReasons)).NotNull(); Guard.Argument(betStopReasons, nameof(betStopReasons)).NotNull(); Guard.Argument(bettingStatuses, nameof(bettingStatuses)).NotNull(); Guard.Argument(matchStatuses, nameof(matchStatuses)).NotNull(); VoidReasons = voidReasons; BetStopReasons = betStopReasons; BettingStatuses = bettingStatuses; MatchStatuses = matchStatuses; }
/// <summary> /// Initializes a new instance of the <see cref="Match"/> class. /// </summary> /// <param name="id">A <see cref="URN"/> uniquely identifying the match associated with the current instance</param> /// <param name="sportId">A <see cref="URN"/> uniquely identifying the sport associated with the current instance</param> /// <param name="sportEntityFactory">A <see cref="ISportEntityFactory"/> instance used to construct <see cref="ITournament"/> instances</param> /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instances containing cache data associated with the current instance</param> /// <param name="sportEventStatusCache">A <see cref="ISportEventStatusCache"/> instance containing cache data information about the progress of a match associated with the current instance</param> /// <param name="matchStatusCache">A localized match statuses cache</param> /// <param name="cultures">A <see cref="IEnumerable{CultureInfo}"/> specifying languages the current instance supports</param> /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> enum member specifying how the initialized instance will handle potential exceptions</param> public Match(URN id, URN sportId, ISportEntityFactory sportEntityFactory, ISportEventCache sportEventCache, ISportEventStatusCache sportEventStatusCache, ILocalizedNamedValueCache matchStatusCache, IEnumerable<CultureInfo> cultures, ExceptionHandlingStrategy exceptionStrategy) : base(ExecutionLogPrivate, id, sportId, sportEntityFactory, sportEventStatusCache, sportEventCache, cultures, exceptionStrategy, matchStatusCache) { _sportEntityFactory = sportEntityFactory; }
/// <summary> /// Initializes a new instance of the <see cref="CompetitionStatus"/> class. /// </summary> /// <param name="ci">The status cache item</param> /// <param name="matchStatusesCache">The <see cref="ILocalizedNamedValueCache"/> used to get match status id and description</param> public CompetitionStatus(SportEventStatusCI ci, ILocalizedNamedValueCache matchStatusesCache) { Guard.Argument(ci, nameof(ci)).NotNull(); SportEventStatusCI = ci; WinnerId = ci.WinnerId; Status = ci.Status; ReportingStatus = ci.ReportingStatus; if (ci.EventResults != null) { EventResults = ci.EventResults.Select(s => new EventResult(s, matchStatusesCache)); } Properties = ci.Properties; }
/// <summary> /// Initializes a new instance of the <see cref="CompetitionStatus" /> class. /// </summary> /// <param name="ci">The status cache item</param> /// <param name="matchStatusesCache"> /// The <see cref="ILocalizedNamedValueCache" /> used to get match status id and /// description /// </param> public CompetitionStatus(SportEventStatusCI ci, ILocalizedNamedValueCache matchStatusesCache) { Contract.Requires(ci != null); SportEventStatusCI = ci; WinnerId = ci.WinnerId; Status = ci.Status; ReportingStatus = ci.ReportingStatus; if (ci.EventResults != null) { EventResults = ci.EventResults.Select(s => new EventResult(s, matchStatusesCache)); } Properties = ci.Properties; }
/// <summary> /// Initializes a new instance of the <see cref="MatchStatus"/> class /// </summary> /// <param name="ci">The cache item</param> /// <param name="matchStatusesCache">The match statuses cache</param> public MatchStatus(SportEventStatusCI ci, ILocalizedNamedValueCache matchStatusesCache) : base(ci, matchStatusesCache) { if (ci.EventClock != null) { EventClock = new EventClock(ci.EventClock); } if (ci.PeriodScores != null) { PeriodScores = ci.PeriodScores.Select(s => new PeriodScore(s, MatchStatusCache)); } _homeScore = ci.HomeScore; _awayScore = ci.AwayScore; HomePenaltyScore = ci.HomePenaltyScore; AwayPenaltyScore = ci.AwayPenaltyScore; DecidedByFed = ci.DecidedByFed; }
public Stage(URN id, URN sportId, ISportEntityFactory sportEntityFactory, ISportEventCache sportEventCache, ISportDataCache sportDataCache, ISportEventStatusCache sportEventStatusCache, ILocalizedNamedValueCache matchStatusesCache, IEnumerable <CultureInfo> cultures, ExceptionHandlingStrategy exceptionStrategy) : base(ExecutionLogPrivate, id, sportId, sportEntityFactory, sportEventStatusCache, sportEventCache, cultures, exceptionStrategy, matchStatusesCache) { Guard.Argument(sportDataCache, nameof(sportDataCache)).NotNull(); Guard.Argument(matchStatusesCache, nameof(matchStatusesCache)).NotNull(); _sportEntityFactory = sportEntityFactory; _sportDataCache = sportDataCache; }
public TestSportEntityFactory(ISportDataCache sportDataCache = null, ISportEventCache sportEventCache = null, ISportEventStatusCache eventStatusCache = null, ILocalizedNamedValueCache matchStatusCache = null, IProfileCache profileCache = null, IReadOnlyCollection <URN> soccerSportUrns = null) { _cacheManager = new CacheManager(); var profileMemoryCache = new MemoryCache("ProfileCache"); _sportDataCache = sportDataCache; _sportEventCache = sportEventCache; _eventStatusCache = eventStatusCache; _matchStatusCache = matchStatusCache; _profileCache = profileCache ?? new ProfileCache(profileMemoryCache, new TestDataRouterManager(_cacheManager), _cacheManager); _soccerSportUrns = soccerSportUrns ?? SdkInfo.SoccerSportUrns; }
public Stage(URN id, URN sportId, ISportEntityFactory sportEntityFactory, ISportEventCache sportEventCache, ISportDataCache sportDataCache, ISportEventStatusCache sportEventStatusCache, ILocalizedNamedValueCache matchStatusesCache, IEnumerable <CultureInfo> cultures, ExceptionHandlingStrategy exceptionStrategy) : base(ExecutionLogPrivate, id, sportId, sportEntityFactory, sportEventStatusCache, sportEventCache, cultures, exceptionStrategy, matchStatusesCache) { Contract.Requires(sportDataCache != null); Contract.Requires(matchStatusesCache != null); _sportEntityFactory = sportEntityFactory; _sportDataCache = sportDataCache; _matchStatusesCache = matchStatusesCache; }
/// <summary> /// Initializes a new instance of the <see cref="SportEntityFactory"/> class /// </summary> /// <param name="sportDataCache">A <see cref="ISportDataCache"/> instance used to retrieve sport related info</param> /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instance used to retrieve sport events</param> /// <param name="eventStatusCache">A <see cref="ISportEventStatusCache"/> used to retrieve statuses of sport events</param> /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve match statuses</param> /// <param name="profileCache">A <see cref="IProfileCache"/> used to retrieve player profiles</param> public SportEntityFactory( ISportDataCache sportDataCache, ISportEventCache sportEventCache, ISportEventStatusCache eventStatusCache, ILocalizedNamedValueCache matchStatusCache, IProfileCache profileCache) { Guard.Argument(sportDataCache, nameof(sportDataCache)).NotNull(); Guard.Argument(sportEventCache, nameof(sportEventCache)).NotNull(); Guard.Argument(eventStatusCache, nameof(eventStatusCache)).NotNull(); Guard.Argument(matchStatusCache, nameof(matchStatusCache)).NotNull(); Guard.Argument(profileCache, nameof(profileCache)).NotNull(); _sportDataCache = sportDataCache; _sportEventCache = sportEventCache; _eventStatusCache = eventStatusCache; _matchStatusCache = matchStatusCache; _profileCache = profileCache; }
/// <summary> /// Initializes a new instance of the <see cref="SportEntityFactory"/> class /// </summary> /// <param name="sportDataCache">A <see cref="ISportDataCache"/> instance used to retrieve sport related info</param> /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instance used to retrieve sport events</param> /// <param name="eventStatusCache">A <see cref="ISportEventStatusCache"/> used to retrieve statuses of sport events</param> /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve match statuses</param> /// <param name="profileCache">A <see cref="IProfileCache"/> used to retrieve player profiles</param> public SportEntityFactory( ISportDataCache sportDataCache, ISportEventCache sportEventCache, ISportEventStatusCache eventStatusCache, ILocalizedNamedValueCache matchStatusCache, IProfileCache profileCache) { Contract.Requires(sportDataCache != null); Contract.Requires(sportEventCache != null); Contract.Requires(eventStatusCache != null); Contract.Requires(matchStatusCache != null); Contract.Requires(profileCache != null); _sportDataCache = sportDataCache; _sportEventCache = sportEventCache; _eventStatusCache = eventStatusCache; _matchStatusCache = matchStatusCache; _profileCache = profileCache; }
/// <summary> /// Initializes a new instance of the <see cref="Competition"/> class /// </summary> /// <param name="executionLog">A <see cref="ILogger"/> instance used for execution logging</param> /// <param name="id">A <see cref="URN"/> uniquely identifying the sport event associated with the current instance</param> /// <param name="sportId">A <see cref="URN"/> uniquely identifying the sport associated with the current instance</param> /// <param name="sportEntityFactory">An instance of a <see cref="ISportEntityFactory"/> used to create <see cref="ISportEvent"/> instances</param> /// <param name="sportEventStatusCache">A <see cref="ISportEventStatusCache"/> instance containing cache data information about the progress of a sport event associated with the current instance</param> /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instance containing <see cref="CompetitionCI"/></param> /// <param name="cultures">A <see cref="IEnumerable{CultureInfo}"/> specifying languages the current instance supports</param> /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> enum member specifying how the initialized instance will handle potential exceptions</param> /// <param name="matchStatusesCache">A <see cref="ILocalizedNamedValueCache"/> cache for fetching match statuses</param> internal Competition(ILogger executionLog, URN id, URN sportId, ISportEntityFactory sportEntityFactory, ISportEventStatusCache sportEventStatusCache, ISportEventCache sportEventCache, IEnumerable <CultureInfo> cultures, ExceptionHandlingStrategy exceptionStrategy, ILocalizedNamedValueCache matchStatusesCache) : base(id, sportId, executionLog, sportEventCache, cultures, exceptionStrategy) { Guard.Argument(id, nameof(id)).NotNull(); Guard.Argument(sportEntityFactory, nameof(sportEntityFactory)).NotNull(); Guard.Argument(sportEventStatusCache, nameof(sportEventStatusCache)).NotNull(); Guard.Argument(matchStatusesCache, nameof(matchStatusesCache)).NotNull(); _sportEntityFactory = sportEntityFactory; SportEventStatusCache = sportEventStatusCache; _matchStatusesCache = matchStatusesCache; }
/// <summary> /// Initializes a new instance of the <see cref="Competition"/> class /// </summary> /// <param name="executionLog">A <see cref="ILog"/> instance used for execution logging</param> /// <param name="id">A <see cref="URN"/> uniquely identifying the sport event associated with the current instance</param> /// <param name="sportId">A <see cref="URN"/> uniquely identifying the sport associated with the current instance</param> /// <param name="sportEntityFactory">An instance of a <see cref="ISportEntityFactory"/> used to create <see cref="ISportEvent"/> instances</param> /// <param name="sportEventStatusCache">A <see cref="ISportEventStatusCache"/> instance containing cache data information about the progress of a sport event associated with the current instance</param> /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instance containing <see cref="CompetitionCI"/></param> /// <param name="cultures">A <see cref="IEnumerable{CultureInfo}"/> specifying languages the current instance supports</param> /// <param name="exceptionStrategy">A <see cref="ExceptionHandlingStrategy"/> enum member specifying how the initialized instance will handle potential exceptions</param> /// <param name="matchStatusesCache">A <see cref="ILocalizedNamedValueCache"/> cache for fetching match statuses</param> internal Competition(ILog executionLog, URN id, URN sportId, ISportEntityFactory sportEntityFactory, ISportEventStatusCache sportEventStatusCache, ISportEventCache sportEventCache, IEnumerable <CultureInfo> cultures, ExceptionHandlingStrategy exceptionStrategy, ILocalizedNamedValueCache matchStatusesCache) : base(id, sportId, executionLog, sportEventCache, cultures, exceptionStrategy) { Contract.Requires(id != null); Contract.Requires(sportEntityFactory != null); Contract.Requires(sportEventStatusCache != null); Contract.Requires(matchStatusesCache != null); _sportEntityFactory = sportEntityFactory; SportEventStatusCache = sportEventStatusCache; _matchStatusesCache = matchStatusesCache; }
/// <summary> /// Initializes a new instance of the <see cref="MatchStatus" /> class /// </summary> /// <param name="ci">The cache item</param> /// <param name="matchStatusesCache">The match statuses cache</param> public MatchStatus(SportEventStatusCI ci, ILocalizedNamedValueCache matchStatusesCache) : base(ci, matchStatusesCache) { Contract.Requires(ci != null); Contract.Requires(matchStatusesCache != null); if (ci.EventClock != null) { EventClock = new EventClock(ci.EventClock); } if (ci.PeriodScores != null) { PeriodScores = ci.PeriodScores.Select(s => new PeriodScore(s, _matchStatusesCache)); } HomeScore = ci.HomeScore ?? 0; AwayScore = ci.AwayScore ?? 0; _matchStatusesCache = matchStatusesCache; HomePenaltyScore = ci.HomePenaltyScore; AwayPenaltyScore = ci.AwayPenaltyScore; }
/// <summary> /// Initializes a new instance of the <see cref="SportEntityFactory"/> class /// </summary> /// <param name="sportDataCache">A <see cref="ISportDataCache"/> instance used to retrieve sport related info</param> /// <param name="sportEventCache">A <see cref="ISportEventCache"/> instance used to retrieve sport events</param> /// <param name="eventStatusCache">A <see cref="ISportEventStatusCache"/> used to retrieve statuses of sport events</param> /// <param name="matchStatusCache">A <see cref="ILocalizedNamedValueCache"/> used to retrieve match statuses</param> /// <param name="profileCache">A <see cref="IProfileCache"/> used to retrieve player profiles</param> /// <param name="soccerSportUrns">A list of sport urns that have soccer matches</param> public SportEntityFactory(ISportDataCache sportDataCache, ISportEventCache sportEventCache, ISportEventStatusCache eventStatusCache, ILocalizedNamedValueCache matchStatusCache, IProfileCache profileCache, IReadOnlyCollection <URN> soccerSportUrns) { Guard.Argument(sportDataCache, nameof(sportDataCache)).NotNull(); Guard.Argument(sportEventCache, nameof(sportEventCache)).NotNull(); Guard.Argument(eventStatusCache, nameof(eventStatusCache)).NotNull(); Guard.Argument(matchStatusCache, nameof(matchStatusCache)).NotNull(); Guard.Argument(profileCache, nameof(profileCache)).NotNull(); Guard.Argument(soccerSportUrns, nameof(soccerSportUrns)).NotNull(); _sportDataCache = sportDataCache; _sportEventCache = sportEventCache; _eventStatusCache = eventStatusCache; _matchStatusCache = matchStatusCache; _profileCache = profileCache; _soccerSportUrns = soccerSportUrns; }
/// <summary> /// Initializes a new instance of the <see cref="MatchStatus"/> class /// </summary> /// <param name="ci">The cache item</param> /// <param name="matchStatusesCache">The match statuses cache</param> public MatchStatus(SportEventStatusCI ci, ILocalizedNamedValueCache matchStatusesCache) : base(ci, matchStatusesCache) { Guard.Argument(ci, nameof(ci)).NotNull(); Guard.Argument(matchStatusesCache, nameof(matchStatusesCache)).NotNull(); if (ci.EventClock != null) { EventClock = new EventClock(ci.EventClock); } if (ci.PeriodScores != null) { PeriodScores = ci.PeriodScores.Select(s => new PeriodScore(s, _matchStatusesCache)); } _homeScore = ci.HomeScore; _awayScore = ci.AwayScore; _matchStatusesCache = matchStatusesCache; HomePenaltyScore = ci.HomePenaltyScore; AwayPenaltyScore = ci.AwayPenaltyScore; DecidedByFed = ci.DecidedByFed; }
/// <summary> /// Initializes a new instance of the <see cref="MatchStatus"/> class /// </summary> /// <param name="ci">The cache item</param> /// <param name="matchStatusesCache">The match statuses cache</param> public StageStatus(SportEventStatusCI ci, ILocalizedNamedValueCache matchStatusesCache) : base(ci, matchStatusesCache) { }