Beispiel #1
0
        public static Result Merge(string[] inputs, string output)
        {
            var validateResult = ParameterValidator.Validate(inputs, output);

            if (!validateResult.IsSuccessful)
            {
                return(validateResult);
            }

            var(loadResult, loadedStories) = InputsLoader.Load(inputs);
            if (!loadResult.IsSuccessful)
            {
                return(validateResult);
            }

            var outputStory    = new S2VXStory();
            var notesResult    = NotesMerger.Merge(loadedStories, outputStory);
            var commandsResult = CommandsMerger.Merge(loadedStories, outputStory);

            outputStory.Save(output);

            var messages = new[] {
                $"Merged {inputs.Length} stories into \"{output}\"",
                notesResult.Message,
                commandsResult.Message
            };
            var message = string.Join("\n\n", messages);

            return(new Result {
                IsSuccessful = true,
                Message = message
            });
        }
Beispiel #2
0
            public void SetUp()
            {
                var story    = new S2VXStory();
                var holdNote = new EditorHoldNote {
                    HitTime        = 100,
                    EndTime        = 400,
                    Coordinates    = new(1, 1),
                    EndCoordinates = new(4, 4),
                };

                holdNote.MidCoordinates.Add(new(2, 2));
                holdNote.MidCoordinates.Add(new(3, 3));
                story.AddNote(holdNote);

                var filePath = "HoldNoteLoadingTests_Open_HoldNote_SetUp.s2ry";

                story.Save(filePath);

                var newStory = new S2VXStory();

                newStory.Open(filePath, true);
                LoadedHoldNote = newStory.Notes.GetHoldNotes().First();
            }