Ejemplo n.º 1
0
 /// <summary>
 /// Initializes the separate thread logic.
 /// </summary>
 /// <param name="match">The <see cref="Match"/> to automatically step.</param>
 public MatchControls(Match match)
 {
     controllingMatch = match;
     IsRunning = false;
     Delay = 0;
     Thread = new Thread(PlayLoop);
     SleepHandle = new AutoResetEvent(false);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes various internal variables.
 /// </summary>
 /// <param name="match">The <see cref="Match"/> to base settings on.</param>
 public RoundIterator(Match match)
 {
     MonitoringMatch = match;
     TargetRounds = MonitoringMatch.Config.GetValue<int>("mbc_match_rounds");
     CurrentRoundIdx = 0;
     RoundList = new List<Round>();
     roundsReached = false;
 }
Ejemplo n.º 3
0
 public FirstToRoundIterator(Match match)
     : base(match)
 {
 }
Ejemplo n.º 4
0
 public PlayAllRoundIterator(Match match)
     : base(match)
 {
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Creates a <see cref="RoundIterator"/> for a specific <paramref name="match"/>.
        /// </summary>
        /// <param name="match">The <see cref="Match"/> that requires a new <see cref="RoundIterator"/>.</param>
        /// <returns>A <see cref="RoundIterator"/>.</returns>
        public static RoundIterator CreateRoundIteratorFor(Match match)
        {
            RoundIterator iterator = null;
            switch (match.Config.GetValue<Mode>("mbc_match_rounds_mode"))
            {
                case Mode.AllRounds:
                    iterator = new PlayAllRoundIterator(match);
                    break;

                case Mode.FirstTo:
                    iterator = new FirstToRoundIterator(match);
                    break;
            }
            return iterator;
        }