public void Handle(TeamGameCompleted e) { var match = Matches[e.Id]; var team = (match.Home.Province == e.Contingent) ? match.Home : match.Away; team.Id = e.TeamId; team.Score = e.Score; team.POA = e.POA; team.Points = e.Points; team.TotalPoints = e.TotalPoints; }
public void Handle(TeamGameCompleted e) { var isPOASingles = e.IsPOA && e.Division.Contains("Single"); Guid actualTeamId = isPOASingles ? Singles[e.TeamId] : e.TeamId; var team = Teams.SingleOrDefault(x => x.Id == actualTeamId); if (team == null) { var t = Teams.Single(x => x.Id == e.TeamId); var contingent = Contingents.Single(x => x.Id == t.ContingentId); team = new Team { Id = actualTeamId, TeamId = actualTeamId.ToString(), ContingentId = contingent.Id, Province = contingent.Province, Division = e.Division, }; Teams.Add(team); } //Remove any previous entries as they could re-enter the scores team.Matches.RemoveAll(x => x.Id == e.Id); team.Matches.Add(new Match { Id = e.Id, IsPOA = e.IsPOA, Number = e.Number, Opponent = e.Opponent, POA = e.POA, Points = e.Points, Score = e.Score, TotalPoints = e.TotalPoints, WinLossTie = e.IsPOA ? (e.POA > e.OpponentPOA ? "W" : e.POA < e.OpponentPOA ? "L" : "T") : (e.Score > e.OpponentScore ? "W" : e.Score < e.OpponentScore ? "L" : "T"), }); }
public void Apply(TeamGameCompleted e) { //TODO: }