private async void Save()
        {
            var lastMatch = MatchHistory.LastMatch;

            MatchRecord newMatch;

            if (lastMatch != null)
            {
                newMatch = lastMatch.NewRelativeRecord(CR.Value, DateTime.Now, SelectedMap);
            }
            else
            {
                await _dialogService.ShowMessage("Recording first game as a win, because there are no previous records to base it on", "Recording new match");

                newMatch = new MatchRecord()
                {
                    CR     = CR.Value,
                    Diff   = CR.Value,
                    Date   = DateTime.Now,
                    Map    = SelectedMap,
                    Result = MatchResult.WIN
                };
            }


            MatchHistory.Add(newMatch);
            MessengerInstance.Send(new Messages.NewMatchRecord(newMatch));

            CR          = null;
            SelectedMap = Maps.First();
        }
Example #2
0
        public void SymulateGroupStage()
        {
            foreach (var match in MatchPlanned.List)
            {
                match.SymulateGame();
                MatchHistory.Add(match);
                MatchPlanned.Count--;
            }

            MatchPlanned.List      = new List <Match>();
            WasGroupStageSymulated = true;
            SortTeamsPoints();
            if (TeamList.Count >= 4)
            {
                SemiA = RankingTeam[0];
                SemiB = RankingTeam[1];
                SemiC = RankingTeam[2];
                SemiD = RankingTeam[3];
            }

            else if (TeamList.Count >= 2)
            {
                FinalA = RankingTeam[0];
                FinalB = RankingTeam[1];
            }
        }
Example #3
0
 public void AddMatchToHistory(MyMatch match)
 {
     MatchHistory.Add(match);
 }