コード例 #1
0
        public void AddLost(CyberFootballMatch t)
        {
            CurrentWinTeams.Clear();
            CurrentDrawTeams.Clear();
            CurrentLostTeams.Add(t);

            if (CurrentLostTeams.Count > LongesLostTeams.Length)
            {
                LongesLostTeams = CurrentLostTeams.ToArray();
            }
        }
コード例 #2
0
        public static CyberFootballMatch FromHistoricalResult(CyberFootballHistoricalMatchResult historicalMatch)
        {
            var evno = historicalMatch.Evno;

            var p1origin = historicalMatch.HomeTeam;
            var p2origin = historicalMatch.AwayTeam;

            if (string.IsNullOrEmpty(p1origin) || string.IsNullOrEmpty(p2origin))
            {
                return(null);
            }

            var m = new CyberFootballMatch();

            try
            {
                var dt = DateTime.Parse(historicalMatch.Date, CultureInfo.InvariantCulture);

                m.EventNo      = evno;
                m.DateTime     = dt;
                m.Competition  = historicalMatch.Competition;
                m.Team1Origin  = p1origin;
                m.Player1      = CyberFootballPlayer(p1origin);
                m.Team2Origin  = p2origin;
                m.Player2      = CyberFootballPlayer(p2origin);
                m.OriginResult = historicalMatch.Result.Trim();
            }
            catch (Exception)
            {
            }

            try
            {
                m.Result = FootballResult.FromString(historicalMatch.Result);
            }
            catch (Exception)
            {
                m.Result = null;
            }

            return(m);;
        }
コード例 #3
0
        public static CyberFootballMatch FromLiveMatch(SportLiveMatch liveMatch)
        {
            var evno = liveMatch.EventNo;

            var p1origin = liveMatch.Team1;
            var p2origin = liveMatch.Team2;

            if (string.IsNullOrEmpty(p1origin) || string.IsNullOrEmpty(p2origin))
            {
                return(null);
            }

            var m = new CyberFootballMatch
            {
                EventNo   = evno,
                Player1   = CyberFootballPlayer(p1origin),
                Player2   = CyberFootballPlayer(p2origin),
                LiveMatch = liveMatch
            };

            return(m);
        }
コード例 #4
0
 public static string Key(CyberFootballMatch lbm) =>
 $"{lbm.EventNo}{lbm.Player1.Team}{lbm.Player1.Name}{lbm.Player2.Team}{lbm.Player1.Name}";
コード例 #5
0
 public static string Key(CyberFootballMatch match) =>
 $"{match.EventNo}{match.Player1.Team}{match.Player1.Name}{match.Player2.Team}{match.Player1.Name}";