using System.Collections; using System.Collections.Generic; using Ichni.RhythmGame.Beatmap; using UnityEngine; namespace Ichni.RhythmGame { public class BeatmapContainer : IBaseElement { public List gameElementList; public BaseElement_BM matchedBM { get; set; } public BeatmapContainer() { gameElementList = new List(); } public void SaveBM() { matchedBM = new BeatmapContainer_BM(gameElementList); } public void SetUpInspector() { throw new System.NotImplementedException(); } public void Refresh() { throw new System.NotImplementedException(); } } namespace Beatmap { public class BeatmapContainer_BM : BaseElement_BM { public List elementList; public BeatmapContainer_BM() { } public BeatmapContainer_BM(List gameElementList) { elementList = new List(); gameElementList.ForEach(e => { e.SaveBM(); e.submoduleList.RemoveAll(s=>s == null); e.submoduleList.ForEach(s => s.SaveBM()); }); foreach (var gameElement in gameElementList) { elementList.Add(gameElement.matchedBM); elementList.AddRange(gameElement.submoduleList.ConvertAll(submodule => submodule.matchedBM)); } } public override void ExecuteBM() { EditorManager.instance.beatmapContainer = new BeatmapContainer(); elementList.ForEach(element => { if (element is GameElement_BM gameElement) { GameElement_BM.identifier.Add(gameElement.elementGuid, gameElement); } element.ExecuteBM(); }); } } } }