public static ImageBox[] ReduceImageRequest(ImageBox[] images, ImageRequestAction action)
        {
            var(index, url) = action;

            ReducerValidators.ValidateLength(images);
            ReducerValidators.ValidateIndex(images, index);

            var newImageBox = images[index].TransitionToLoading(url);

            return(SetItem(images, index, newImageBox));
        }
        public static ImageBox[] ReduceClearSlot(ImageBox[] images, ClearImageSlotAction action)
        {
            var index = action.Slot;

            ReducerValidators.ValidateLength(images);
            ReducerValidators.ValidateIndex(images, index);
            var slot = EnforceSlotType <ImageBox.Loaded>(images[index]);

            var newImageBox = slot.TransitionToEmpty();

            return(SetItem(images, index, newImageBox));
        }
        public static ImageBox[] ReduceImageResult(ImageBox[] images, ImageResultAction action)
        {
            var(index, texture) = action;

            ReducerValidators.ValidateLength(images);
            ReducerValidators.ValidateIndex(images, index);
            var slot = EnforceSlotType <ImageBox.Loading>(images[index]);

            var newImageBox = slot.TransitionToLoaded(texture);

            return(SetItem(images, index, newImageBox));
        }
        public static ImageBox[] Reduce(ImageBox[] images, DeleteImageSlotAction action)
        {
            var index = action.Slot;

            ReducerValidators.ValidateLength(images);
            ReducerValidators.ValidateIndex(images, index);

            var newArray = new ImageBox[images.Length - 1];

            Array.Copy(images, 0, newArray, 0, index);
            Array.Copy(images, index + 1, newArray, index, images.Length - (index + 1));

            return(newArray);
        }