Example #1
0
        private void MakeSortition()
        {
            UpdatePoints();
            List <Player> players = new List <Player>();

            // Вызов жеребьевки
            switch (System)
            {
            case TournamentSystem.Circle:
                players = Sortitions.CircleSystem(this.players.ToList());
                break;

            case TournamentSystem.MakMagon:
                players = Sortitions.MakmagonSystem(this.players.ToList(), CurrentTour + 1);
                break;
            }

            // Случай, когда неозможно провести жеребьевку
            if (players is null)
            {
                throw new ArgumentException("Неозможно провести жеребьевку!");
            }

            this.players.Clear();
            foreach (Player p in players)
            {
                this.players.Add(p);
            }
        }
        static void Main(string[] args)
        {
            List <Player> players = new List <Player>();

            Sortitions.MakmagonSystem(players, 1);

            TestEnum en = TestEnum.X;

            foreach (var val in Enum.GetNames(typeof(TestEnum)))
            {
                Console.WriteLine(val);
            }
            Type enumType = typeof(TestEnum);

            foreach (string enumName in enumType.GetEnumNames())
            {
                Console.WriteLine(enumName);
                Console.WriteLine(enumType.GetMember(enumName)[0].GetCustomAttribute <DescriptionAttribute>().Description);
            }
        }