Exemple #1
0
        public Tournament()
        {
            m_ParticipantsPerMatch  = 2;
            m_PlayersPerParticipant = 1;
            Pyramid = new TourneyPyramid();
            Ruleset = new Ruleset(RulesetLayout.Root);
            Ruleset.ApplyDefault(Ruleset.Layout.Defaults[0]);
            Participants = new List <TourneyParticipant>();
            Undefeated   = new List <TourneyParticipant>();
            Arenas       = new List <Arena>();
            SignupPeriod = TimeSpan.FromMinutes(10.0);

            Timer.DelayCall(SliceInterval, SliceInterval, Slice);
        }
Exemple #2
0
        public Tournament(IGenericReader reader)
        {
            int version = reader.ReadEncodedInt();

            switch (version)
            {
            case 5:
            {
                FactionRestricted = reader.ReadBool();

                goto case 4;
            }

            case 4:
            {
                EventController = reader.ReadItem() as EventController;

                goto case 3;
            }

            case 3:
            {
                SuddenDeathRounds = reader.ReadEncodedInt();

                goto case 2;
            }

            case 2:
            {
                TourneyType = (TourneyType)reader.ReadEncodedInt();

                goto case 1;
            }

            case 1:
            {
                GroupType    = (GroupingType)reader.ReadEncodedInt();
                TieType      = (TieType)reader.ReadEncodedInt();
                SignupPeriod = reader.ReadTimeSpan();

                goto case 0;
            }

            case 0:
            {
                if (version < 3)
                {
                    SuddenDeathRounds = 3;
                }

                m_ParticipantsPerMatch  = reader.ReadEncodedInt();
                m_PlayersPerParticipant = reader.ReadEncodedInt();
                SignupPeriod            = reader.ReadTimeSpan();
                CurrentStage            = TournamentStage.Inactive;
                Pyramid = new TourneyPyramid();
                Ruleset = new Ruleset(RulesetLayout.Root);
                Ruleset.ApplyDefault(Ruleset.Layout.Defaults[0]);
                Participants = new List <TourneyParticipant>();
                Undefeated   = new List <TourneyParticipant>();
                Arenas       = new List <Arena>();

                break;
            }
            }

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