Esempio n. 1
0
        static string GetControlForTeamSize(Day day, int matchIndex, HTMLmode mode)
        {
            Match match = day.matches[matchIndex];

            if (mode != HTMLmode.FixMatches)
            {
                return(EnumStringConverter.NameOfTeamSize(match.Size));
            }
            string controls = string.Format(dropDownTeamSizeStart, matchIndex);

            for (int size = Team.MinSize; size <= Team.MaxSize; size++)
            {
                controls += string.Format(match.Size == size ? dropDownTeamSizeOptionSelected : dropDownTeamSizeOptionNotSelected, size, EnumStringConverter.NameOfTeamSize(size));
            }
            controls += dropDownTeamSizeEnd;
            return(controls);
        }
Esempio n. 2
0
        private void ScripterFixGames_SizeChanged(int matchIndex, int value)
        {
            Match match = fixedMatchesDay.matches[matchIndex];

            match.SetTeamSize(new MatchSize(value));
            foreach (Team team in match.teams)
            {
                for (int position = 0; position < Team.MaxSize; position++)
                {
                    if (!team.PositionShouldBeFilled((Position)position))
                    {
                        team.players[position] = null;
                    }
                }
            }
            swapPlayerIndexForFixing   = -1;
            toolStripStatusLabel1.Text = $"Changed a match to {EnumStringConverter.NameOfTeamSize(value)}";
            DisplayFixedMatches();
        }