コード例 #1
0
        private void FillPlayerGames()
        {
            //spPlayerGames
            ViewMatches view = new ViewMatches(_player.PlayedGamesThisYear(), true, false, false, false, false, true);

            view.Full(spPlayerGames);
        }
コード例 #2
0
        public void FillGames()
        {
            List <Match> matchs = _club.Games;
            ViewMatches  view   = new ViewMatches(matchs, true, true, false, true, false, true, 14, true, _club);

            view.Full(spMatchs);
        }
コード例 #3
0
        public Windows_AvantMatch(List <Match> m, Club c)
        {
            InitializeComponent();
            _joueurs = new List <Player>();
            _matchs  = m;
            _club    = c;

            ViewMatches view = new ViewMatches(_matchs, false, true, false, false, true, false, 10);

            view.Full(spGames);

            foreach (Player j in c.Players())
            {
                dgJoueursDispo.Items.Add(new JoueurCompoElement {
                    Poste = j.position.ToString(), Age = j.Age, Energie = j.energy, Niveau = j.level, Nom = j
                });
            }

            lbMatch.Content = m[0].home + " - " + m[0].away;
            lbStade.Content = m[0].home.stadium.name;
            lbCote1.Content = m[0].odd1.ToString("0.00");
            lbCoteN.Content = m[0].oddD.ToString("0.00");
            lbCote2.Content = m[0].odd2.ToString("0.00");
            try
            {
                imgEquipe1.Source = new BitmapImage(new Uri(Utils.Logo(m[0].home)));
                imgEquipe2.Source = new BitmapImage(new Uri(Utils.Logo(m[0].away)));
            }
            catch
            {
                //We don't show any logo if one club has no logo
            }
        }
コード例 #4
0
        private void NextGamesOfClub()
        {
            if (_partie.club != null)
            {
                List <Match> matches     = new List <Match>();
                List <Match> clubMatches = new List <Match>();
                foreach (Match m in _partie.kernel.Matchs)
                {
                    if (m.home == _partie.club || m.away == _partie.club)
                    {
                        clubMatches.Add(m);
                    }
                }
                clubMatches.Sort(new MatchDateComparator());
                int diff   = -1;
                int indice = -1;
                foreach (Match m in clubMatches)
                {
                    TimeSpan ts = m.day - _partie.date;

                    int diffM = Math.Abs(ts.Days);
                    if (diffM < diff || diff == -1)
                    {
                        diff   = diffM;
                        indice = clubMatches.IndexOf(m);
                    }
                }
                indice = indice - 2;
                if (indice < 0)
                {
                    indice = 0;
                }

                if (indice > clubMatches.Count - 3)
                {
                    indice = clubMatches.Count - 3;
                }
                for (int i = indice; i < indice + 5; i++)
                {
                    //Case if there is less than 5 games for the club
                    if (i < clubMatches.Count && i >= 0)
                    {
                        matches.Add(clubMatches[i]);

                        /*Match m = matchs[i];
                         * string score = m.score1 + " - " + m.score2;
                         * if (!m.Played)
                         * {
                         *  score = m.day.ToShortDateString();
                         * }
                         * dgClubProchainsMatchs.Items.Add(new ProchainMatchElement { Match = m, Competition = m.Tournament, ShortName = m.Tournament.shortName, Equipe1 = m.home.shortName, Equipe2 = m.away.shortName, Score = score, LogoD = Utils.Logo(m.home), LogoE = Utils.Logo(m.away) });*/
                    }
                }


                ViewMatches viewMatches = new ViewMatches(matches, true, false, false, false, false, true);
                viewMatches.Full(spNextMatches);
            }
        }
コード例 #5
0
        public void FillGamesOfDayPanel()
        {
            List <Match> matchs = Session.Instance.Game.kernel.MatchsOfDate(Session.Instance.Game.date);

            matchs.Sort(new MatchDateComparator());
            ViewMatches view = new ViewMatches(matchs, false, true, false, false, false, true, 11, false, null, false, false, false, true);

            view.Full(spFullGames);
        }
コード例 #6
0
        private void Calendrier(Round t)
        {
            List <Match> matchs = t.GetMatchesByDate(_resultsCurrentDate);

            matchs.Sort(new MatchDateComparator());
            lbRoundDate.Content = _resultsCurrentDate.ToLongDateString();
            ViewMatches view = new ViewMatches(matchs, false, true, true, true, true, false);

            view.Full(spRoundGames);
        }
コード例 #7
0
        private void Calendrier()
        {
            spMatchs.Children.Clear();

            List <Match> matchs = Journee();

            matchs.Sort(new MatchDateComparator());

            ViewMatches view = new ViewMatches(matchs, true, true, true, false, false, false, 17, false, null, true, true, true, false, 1.5f);

            view.Full(spMatchs);
        }
コード例 #8
0
        private void Map_ShapeIdentified(object sender, AxMapWinGIS._DMapEvents_ShapeIdentifiedEvent e)
        {
            if (e.shapeIndex > -1)
            {
                spJournalistInfo.Children.Clear();

                Journalist j = _media.journalists[_indexOrders[e.shapeIndex]];
                spJournalistInfo.Children.Add(ViewUtils.CreateLabel(j.ToString() + " (" + j.age + " ans)", "StyleLabel2", 12, -1));
                spJournalistInfo.Children.Add(ViewUtils.CreateLabel("Basé à " + j.baseCity.Name, "StyleLabel2", 12, -1));
                List <Match> commentedGames = j.CommentedGames;
                commentedGames.Sort(new MatchDateComparator());
                ViewMatches view = new ViewMatches(commentedGames, true, false, false, false, false, true);
                view.Full(spMatches);
            }
        }
コード例 #9
0
        private void Matchs()
        {
            ViewMatches view = new ViewMatches(_matchs, false, false, false, false, false, false);

            view.Full(spGames);
        }