Пример #1
0
        /// <summary>
        ///     Adds all actions used in ValidActions to the end of the provided list.
        /// </summary>
        /// <param name="list"></param>
        /// <param name="state"></param>
        /// <returns>List, with all actions from ValidActions applied to the end, using the supplied state as first action.</returns>
        public static List <StateOfBottles> AddAnotherRound(List <StateOfBottles> list, StateOfBottles state)
        {
            var variant = Enum.GetValues(typeof(ValidActions)).Cast <ValidActions>();

            foreach (var action in variant)
            {
                //Console.WriteLine($"Performing action: {action}");
                list.Add(state.Perform(action));
            }
            return(list);
        }