Пример #1
0
        public Tournament()
        {
            this.m_ParticipantsPerMatch = 2;
            this.m_PlayersPerParticipant = 1;
            this.m_Pyramid = new TournyPyramid();
            this.m_Ruleset = new Ruleset(RulesetLayout.Root);
            this.m_Ruleset.ApplyDefault(this.m_Ruleset.Layout.Defaults[0]);
            this.m_Participants = new ArrayList();
            this.m_Undefeated = new ArrayList();
            this.m_Arenas = new ArrayList();
            this.m_SignupPeriod = TimeSpan.FromMinutes(10.0);

            Timer.DelayCall(SliceInterval, SliceInterval, new TimerCallback(Slice));
        }
Пример #2
0
        public Tournament(GenericReader reader)
        {
            int version = reader.ReadEncodedInt();

            switch ( version )
            {
                case 4:
                    {
                        this.m_EventController = reader.ReadItem() as EventController;

                        goto case 3;
                    }
                case 3:
                    {
                        this.m_SuddenDeathRounds = reader.ReadEncodedInt();

                        goto case 2;
                    }
                case 2:
                    {
                        this.m_TournyType = (TournyType)reader.ReadEncodedInt();

                        goto case 1;
                    }
                case 1:
                    {
                        this.m_GroupType = (GroupingType)reader.ReadEncodedInt();
                        this.m_TieType = (TieType)reader.ReadEncodedInt();
                        this.m_SignupPeriod = reader.ReadTimeSpan();

                        goto case 0;
                    }
                case 0:
                    {
                        if (version < 3)
                            this.m_SuddenDeathRounds = 3;

                        this.m_ParticipantsPerMatch = reader.ReadEncodedInt();
                        this.m_PlayersPerParticipant = reader.ReadEncodedInt();
                        this.m_SignupPeriod = reader.ReadTimeSpan();
                        this.m_Stage = TournamentStage.Inactive;
                        this.m_Pyramid = new TournyPyramid();
                        this.m_Ruleset = new Ruleset(RulesetLayout.Root);
                        this.m_Ruleset.ApplyDefault(this.m_Ruleset.Layout.Defaults[0]);
                        this.m_Participants = new ArrayList();
                        this.m_Undefeated = new ArrayList();
                        this.m_Arenas = new ArrayList();

                        break;
                    }
            }

            Timer.DelayCall(SliceInterval, SliceInterval, new TimerCallback(Slice));
        }