Esempio n. 1
0
 /// <summary>
 /// The main base contructor that takes in a <paramref name="config"/>.
 /// </summary>
 /// <param name="config">The <see cref="Configuration"/> to use.</param>
 public Match(Configuration config)
 {
     this.config = config;
     info = new CMatchInfo(Config);
     Events = new EventIterator();
     this.rounds = RoundIterator.CreateRoundIteratorFor(this);
 }
Esempio n. 2
0
        /// <summary>
        /// Attaches the <see cref="MatchInfo"/> from a <see cref="Match"/> and attaches the
        /// <see cref="ControllerRegister"/>s given. Initializes an empty list of <see cref="Round.Events"/>
        /// and <see cref="Round.Accolades"/>.
        /// </summary>
        /// <param name="inputRegisters">A variable number of controllers that are involved in this Round.</param>
        /// <param name="matchInfo">Information about the match that determines Round behaviour.</param>
        public Round(MatchInfo matchInfo, List<Register> inputRegisters)
        {
            MatchInfo = matchInfo;

            events = new EventIterator();
            Registers = new List<Register>();
            Remaining = new List<ControllerID>();
            generatedAccolades = new List<Accolade>();
            accoladeGenerator = new AccoladeGenerator(this);

            var newRandom = new Random();
            foreach (var register in inputRegisters)
            {
                Registers.Add(register);
                Remaining.Add(register.ID);
            }
            CurrentTurn = Remaining[newRandom.Next(Remaining.Count)];
        }