/// <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; }
/// <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="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; }