private void FillPlayerGames()
        {
            //spPlayerGames
            ViewMatches view = new ViewMatches(_player.PlayedGamesThisYear(), true, false, false, false, false, true);

            view.Full(spPlayerGames);
        }
        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);
        }
        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
            }
        }
        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);
            }
        }
 private void Start()
 {
     boosterFinding  = FindObjectOfType <BoosterFinding>();
     boosterMatching = FindObjectOfType <BoosterMatching>();
     viewMatches     = FindObjectOfType <ViewMatches>();
     matchedList     = new List <int[]>();
     data            = FindObjectOfType <Data>();
 }
        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);
        }
        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);
        }
Example #8
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);
        }
        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);
            }
        }
        private void Matchs()
        {
            ViewMatches view = new ViewMatches(_matchs, false, false, false, false, false, false);

            view.Full(spGames);
        }
Example #11
0
        static void Main(string[] args)
        {
            ConsoleKeyInfo saisie;

            do
            {
                //menu principal
                int startMenu = ViewMenu.StartMenu();
                //scores
                if (startMenu == 1)
                {
                    ContMenu.ExecScores();
                }
                //points
                if (startMenu == 2)
                {
                    ContMenu.ExecPoints();
                }
                //nations
                if (startMenu == 3)
                {
                    int confMenu = ViewConf.MenuConf();
                    //Europe
                    Conf europe = new Conf("Europe", "European", 54, "2018");
                    ViewConf.DoViewConf(europe);
                    TimeZoneInfo euZone = TimeZoneInfo.FindSystemTimeZoneById("Romance Standard Time");
                    if (confMenu == 1)
                    {
                        int natMenu = ViewNation.MenuNations();
                        //France
                        if (natMenu == 1)
                        {
                            Nation france = new Nation("France", 302.40, 0, europe, "Stade de France", "2018", 10, 3);
                            ViewNation.DoViewNation(france);
                            ViewCup.DoViewCup("World Cup", 0, "qualifications", "2021");
                            string confCup = france.Conf.Adj + " Cup";
                            ViewCup.DoViewCup(confCup, 1, "finalist", "2019");
                            String confLeague = "League of Nations - " + france.Conf.Name;
                            ViewLeague.DoViewLeague(confLeague, "1A", "N/A");
                            char[] results = new char[5];
                            for (int i = 0; i < results.Length; i++)
                            {
                                results[i] = 'V';
                            }
                            for (int i = 0; i < results.Length; i++)
                            {
                                Console.Write(results[i]);
                            }
                            Console.Write("\n\n");
                            List <Match> tabMatches = new List <Match>();

                            DateTime locDate1 = new DateTime(2020, 03, 06, 20, 00, 00, DateTimeKind.Utc);
                            tabMatches.Add(new Match("France", 18, "Albania", 9, locDate1));

                            DateTime locDate2 = new DateTime(2020, 02, 12, 20, 00, 00, DateTimeKind.Utc);
                            tabMatches.Add(new Match("France", 23, "Cyprus", 9, locDate2));

                            DateTime locDate3 = new DateTime(2020, 02, 07, 20, 00, 00, DateTimeKind.Utc);
                            tabMatches.Add(new Match("France", 23, "Israel", 9, locDate3));

                            DateTime locDate4 = new DateTime(2020, 01, 08, 20, 00, 00, DateTimeKind.Utc);
                            tabMatches.Add(new Match("France", 23, "Moldova", 16, locDate4));

                            DateTime locDate5 = new DateTime(2020, 01, 03, 20, 00, 00, DateTimeKind.Utc);
                            tabMatches.Add(new Match("France", 23, "Italy", 13, locDate5));

                            foreach (Match item in tabMatches)
                            {
                                ViewMatches.DoViewMatches(item, euZone);
                            }
                        }

                        //Italy
                        if (natMenu == 2)
                        {
                            Nation italy = new Nation("Italy", 127.58, 0, europe, "Stadio Olympico", "2018", 31, 11);
                            ViewNation.DoViewNation(italy);
                            ViewCup.DoViewCup("World Cup", 0, "qualifications", "2021");
                            String confCup = italy.Conf.Adj + " Cup";
                            ViewCup.DoViewCup(confCup, 1, "quarter-finalist", "2019");
                            String confLeague = "League of Nations - " + italy.Conf.Name;
                            ViewLeague.DoViewLeague(confLeague, "2A", "N/A");
                            char[] results = new char[5];
                            results[0] = 'V';
                            results[1] = 'V';
                            results[2] = 'V';
                            results[3] = 'V';
                            results[4] = 'D';
                            for (int i = 0; i < results.Length; i++)
                            {
                                Console.Write(results[i]);
                            }
                            Console.Write("\n\n");
                            Match[] tabMatches = new Match[5];

                            DateTime locDate1 = new DateTime(2020, 03, 06, 20, 00, 00, DateTimeKind.Utc);
                            tabMatches[0] = new Match("Italy", 18, "Cyprus", 13, locDate1);

                            DateTime locDate2 = new DateTime(2020, 02, 12, 20, 00, 00, DateTimeKind.Utc);
                            tabMatches[1] = new Match("Italy", 18, "Albania", 9, locDate2);

                            DateTime locDate3 = new DateTime(2020, 02, 07, 20, 00, 00, DateTimeKind.Utc);
                            tabMatches[2] = new Match("Italy", 16, "Moldova", 9, locDate3);

                            DateTime locDate4 = new DateTime(2020, 01, 08, 20, 00, 00, DateTimeKind.Utc);
                            tabMatches[3] = new Match("Italy", 18, "Israel", 13, locDate4);

                            DateTime locDate5 = new DateTime(2020, 01, 03, 20, 00, 00, DateTimeKind.Utc);
                            tabMatches[4] = new Match("France", 23, "Italy", 13, locDate5);

                            for (int i = 0; i < tabMatches.Length; i++)
                            {
                                ViewMatches.DoViewMatches(tabMatches[i], euZone);
                            }
                        }
                    }
                }
                Console.WriteLine("Quitter ? y/n");
                saisie = Console.ReadKey(true);
            } while (saisie.Key != ConsoleKey.Y);
        }