public ISportDetails GetSportDetail(string sportCode) { if (string.IsNullOrEmpty(sportCode)) { return(null); } Model.Interface.ISportOverview overview = Supervisor.GetSportOverview(sportCode); if (overview == null) { return(null); } SportDetails details = new SportDetails(); FillSportOverview(details, overview); foreach (var fixture in Supervisor.GetFixtures()) { if (string.Equals(fixture.Sport, sportCode)) { // do not include deleted or matchover fixtures if (fixture.ListenerOverview.IsDeleted.GetValueOrDefault() || (fixture.ListenerOverview.MatchStatus.HasValue && (int)fixture.ListenerOverview.MatchStatus.Value >= (int)Integration.Adapter.Model.Enums.MatchStatus.MatchOverUnConfirmed)) { continue; } details.AddFixture(CreateFixtureOverview(fixture)); } } return(details); }
private static ISportDetails GenerateMockedSportDetail(string sportCode) { SportDetails detail = new SportDetails { Name = sportCode, Total = 5, InSetup = 2, InPreMatch = 1, InPlay = 2, InErrorState = 2 }; detail.AddFixture(new FixtureOverview { Id = "123", IsStreaming = true, State = FixtureState.Running, IsInErrorState = false, Competition = "Premier League", CompetitionId = "123212112", StartTime = new DateTime(2014, 2, 17, 9, 0, 0), Description = "Chelsea v QPR" }); detail.AddFixture(new FixtureOverview { Id = "234", IsStreaming = true, State = FixtureState.PreMatch, IsInErrorState = true, Competition = "Premier League", CompetitionId = "fffffffff", StartTime = new DateTime(2014, 2, 17, 14, 0, 0), Description = "Manchester United v Arsenal" }); detail.AddFixture(new FixtureOverview { Id = "345", IsStreaming = false, State = FixtureState.Over, IsInErrorState = false, Competition = "Champions League", CompetitionId = "AAAAAAAAA", StartTime = new DateTime(2014, 3, 18, 20, 0, 0), Description = "Tottenham v Juventus" }); detail.AddFixture(new FixtureOverview { Id = "456", IsStreaming = false, State = FixtureState.Setup, IsInErrorState = true, Competition = "Serie A", CompetitionId = "823702122", StartTime = new DateTime(2014, 2, 17, 9, 0, 0), Description = "Milan v Inter" }); detail.AddFixture(new FixtureOverview { Id = "567", IsStreaming = false, State = FixtureState.Ready, IsInErrorState = false, Competition = "French Division 1", CompetitionId = "1qqqqqqas", StartTime = new DateTime(2014, 3, 17, 17, 0, 0), Description = "PSG v Lion" }); return(detail); }
public ISportDetails GetSportDetail(string sportCode) { if (string.IsNullOrEmpty(sportCode)) return null; Model.Interface.ISportOverview overview = Supervisor.GetSportOverview(sportCode); if (overview == null) return null; SportDetails details = new SportDetails(); FillSportOverview(details, overview); foreach(var fixture in Supervisor.GetFixtures()) { if(string.Equals(fixture.Sport, sportCode)) { // do not include deleted or matchover fixtures if (fixture.ListenerOverview.IsDeleted.GetValueOrDefault() || (fixture.ListenerOverview.MatchStatus.HasValue && (int)fixture.ListenerOverview.MatchStatus.Value >= (int)Integration.Adapter.Model.Enums.MatchStatus.MatchOverUnConfirmed)) continue; details.AddFixture(CreateFixtureOverview(fixture)); } } return details; }
private void OnSportUpdate(Model.Interface.ISportOverview sport) { if (sport == null) { return; } SportDetails details = new SportDetails(); // we don't send out the entire list of fixtures as the // amount of data would be too big FillSportOverview(details, sport); Supervisor.Service.StreamingService.OnSportUpdate(details); }
private static ISportDetails GenerateMockedSportDetail(string sportCode) { SportDetails detail = new SportDetails { Name = sportCode, Total = 5, InSetup = 2, InPreMatch = 1, InPlay = 2, InErrorState = 2 }; detail.AddFixture(new FixtureOverview { Id = "123", IsStreaming = true, State = FixtureState.Running, IsInErrorState = false, Competition = "Premier League", CompetitionId = "123212112", StartTime = new DateTime(2014, 2, 17, 9, 0, 0), Description = "Chelsea v QPR" }); detail.AddFixture(new FixtureOverview { Id = "234", IsStreaming = true, State = FixtureState.PreMatch, IsInErrorState = true, Competition = "Premier League", CompetitionId = "fffffffff", StartTime = new DateTime(2014, 2, 17, 14, 0, 0), Description = "Manchester United v Arsenal" }); detail.AddFixture(new FixtureOverview { Id = "345", IsStreaming = false, State = FixtureState.Over, IsInErrorState = false, Competition = "Champions League", CompetitionId = "AAAAAAAAA", StartTime = new DateTime(2014, 3, 18, 20, 0, 0), Description = "Tottenham v Juventus" }); detail.AddFixture(new FixtureOverview { Id = "456", IsStreaming = false, State = FixtureState.Setup, IsInErrorState = true, Competition = "Serie A", CompetitionId = "823702122", StartTime = new DateTime(2014, 2, 17, 9, 0, 0), Description = "Milan v Inter" }); detail.AddFixture(new FixtureOverview { Id = "567", IsStreaming = false, State = FixtureState.Ready, IsInErrorState = false , Competition = "French Division 1", CompetitionId = "1qqqqqqas", StartTime = new DateTime(2014, 3, 17, 17, 0, 0), Description = "PSG v Lion" }); return detail; }
private void OnSportUpdate(Model.Interface.ISportOverview sport) { if (sport == null) return; SportDetails details = new SportDetails(); // we don't send out the entire list of fixtures as the // amount of data would be too big FillSportOverview(details, sport); Supervisor.Service.StreamingService.OnSportUpdate(details); }