Exemplo n.º 1
0
 public Beatmap()
 {
     GeneralSection    = new BeatmapGeneralSection();
     EditorSection     = new BeatmapEditorSection();
     MetadataSection   = new BeatmapMetadataSection();
     DifficultySection = new BeatmapDifficultySection();
     EventsSection     = new BeatmapEventsSection();
     ColoursSection    = new BeatmapColoursSection();
 }
        private static bool IsMapBreak(int mapTime, BeatmapEventsSection beatmapEvents)
        {
            foreach (var bmBreak in beatmapEvents.Breaks)
            {
                if (mapTime >= bmBreak.StartTime && mapTime <= bmBreak.EndTime)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 3
0
        public static List <string> EventsSection(BeatmapEventsSection section)
        {
            var list = WriteHelper.BaseListFormat("Events");

            list.AddRange(new List <string>
            {
                @"//Background and Video events",
                $"0,0,\"{section.BackgroundImage}\",0,0",
            });

            if (section.Video != null)
            {
                list.Add($"Video,{section.VideoOffset},\"{section.Video}\"");
            }

            list.Add(@"//Break Periods");
            if (section.Breaks.Any())
            {
                list.AddRange(section.Breaks.ConvertAll(b => $"2,{b.StartTime},{b.EndTime}"));
            }

            list.Add(@"//Storyboard Layer 0 (Background)");
            section.Storyboard.BackgroundLayer.ForEach(sbObject => list.AddRange(WriteHelper.StoryboardObject(sbObject, StoryboardLayer.Background)));
            list.Add(@"//Storyboard Layer 1 (Fail)");
            section.Storyboard.FailLayer.ForEach(sbObject => list.AddRange(WriteHelper.StoryboardObject(sbObject, StoryboardLayer.Fail)));
            list.Add(@"//Storyboard Layer 2 (Pass)");
            section.Storyboard.PassLayer.ForEach(sbObject => list.AddRange(WriteHelper.StoryboardObject(sbObject, StoryboardLayer.Pass)));
            list.Add(@"//Storyboard Layer 3 (Foreground)");
            section.Storyboard.ForegroundLayer.ForEach(sbObject => list.AddRange(WriteHelper.StoryboardObject(sbObject, StoryboardLayer.Foreground)));
            list.Add(@"//Storyboard Layer 4 (Overlay)");
            section.Storyboard.OverlayLayer.ForEach(sbObject => list.AddRange(WriteHelper.StoryboardObject(sbObject, StoryboardLayer.Overlay)));
            list.Add(@"//Storyboard Sound Samples");
            section.Storyboard.SamplesLayer.ForEach(sbObject => list.AddRange(WriteHelper.StoryboardObject(sbObject, (sbObject as Storyboards.Objects.StoryboardSample).Layer)));

            return(list);
        }
 private void UpdateMapCache(int?mapId, BeatmapEventsSection beatmapEvents)
 {
     this.cachedMapId         = mapId;
     this.cachedBeatmapEvents = beatmapEvents;
     //this.cachedBeatmapEvents.Reverse();
 }