Esempio n. 1
0
        /// <summary>
        /// Sets the Random being used
        /// </summary>
        public static RandomSelectorInstance <T> UsingRandom(Random random)
        {
            var instance = new RandomSelectorInstance <T>();

            instance.UsingRandom(random);

            return(instance);
        }
Esempio n. 2
0
        /// <summary>
        /// Add a new value to the selection
        /// </summary>
        /// <param name="value">method to be called</param>
        public static RandomSelectorInstance <T> Add(T value)
        {
            var instance = new RandomSelectorInstance <T>();

            instance.Add(value);

            return(instance);
        }
Esempio n. 3
0
        /// <summary>
        /// Add a new action to the selection
        /// </summary>
        /// <param name="action">method to be called</param>
        public static RandomSelectorInstance Add(Action action)
        {
            var instance = new RandomSelectorInstance();

            instance.Add(action);

            return(instance);
        }
Esempio n. 4
0
        /// <summary>
        /// Add a new value to the selection
        /// </summary>
        /// <param name="weight">percentage chance to call this method</param>
        /// <param name="value">method to be called</param>
        public static RandomSelectorInstance <T> Add(double weight, T value)
        {
            var instance = new RandomSelectorInstance <T>();

            instance.Add(weight, value);

            return(instance);
        }
Esempio n. 5
0
        /// <summary>
        /// Add a new action to the selection
        /// </summary>
        /// <param name="weight">percentage chance to call this method</param>
        /// <param name="action">method to be called</param>
        public static RandomSelectorInstance Add(double weight, Action action)
        {
            var instance = new RandomSelectorInstance();

            instance.Add(weight, action);

            return(instance);
        }