Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
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);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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);
        }