Example #1
0
        /// <summary>
        /// Gets the settings.
        /// </summary>
        /// <param name="type">The type.</param>
        /// <returns></returns>
        public RivalSourceSettings GetSettings(RivalSource type)
        {
            var result = RivalSources.Where(e => e.Source == type).FirstOrDefault();

            if (result == null)
            {
                result = new RivalSourceSettings {
                    Source = type
                };
                RivalSources.Add(result);
            }
            return(result);
        }
Example #2
0
File: Rival.cs Project: minskowl/MY
        /// <summary>
        /// Creates the rival.
        /// </summary>
        /// <param name="browser">The browser.</param>
        /// <param name="source">The source.</param>
        /// <returns></returns>
        public static Rival Create(IE browser, RivalSource source)
        {
            var table = browser.Table(Find.ByClass("attack"));

            if (!table.Exists)
            {
                return(null);
            }
            var rival = new Rival {
                Source = source
            };

            FillUser(rival, table, browser);
            return(rival);
        }
Example #3
0
 /// <summary>
 /// Gets the level filter.
 /// </summary>
 /// <param name="type">The type.</param>
 public LevelFilter GetLevelFilter(RivalSource type)
 {
     return(GetSettings(type).LevelFilter);
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RandomRivalSource"/> class.
 /// </summary>
 /// <param name="machine">The machine.</param>
 /// <param name="mode">The mode.</param>
 /// <param name="type">The type.</param>
 public StaffListRivalSource(FightMachine machine, RandomSearchMode mode, RivalSource type)
     : base(machine)
 {
     this.mode  = mode;
     this._type = type;
 }