90 lines
2.9 KiB
C#
90 lines
2.9 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Ichni.RhythmGame.Beatmap;
|
|
using UnityEngine;
|
|
|
|
namespace Ichni.RhythmGame
|
|
{
|
|
public partial class NoteJudgeSubmodule : SubmoduleBase
|
|
{
|
|
public List<NoteJudgeUnit> judgeUnitList;
|
|
private NoteBase note => attachedGameElement as NoteBase;
|
|
|
|
public NoteJudgeSubmodule(NoteBase attachedGameElement) : base(attachedGameElement)
|
|
{
|
|
judgeUnitList = new List<NoteJudgeUnit>();
|
|
|
|
if (!HaveSameSubmodule)
|
|
{
|
|
this.note.noteJudgeSubmodule = this;
|
|
}
|
|
}
|
|
|
|
public NoteJudgeSubmodule(NoteBase attachedGameElement, List<NoteJudgeUnit_BM> judgeUnitList_BM) : base(attachedGameElement)
|
|
{
|
|
judgeUnitList = new List<NoteJudgeUnit>();
|
|
|
|
foreach (NoteJudgeUnit_BM judgeUnitBM in judgeUnitList_BM)
|
|
{
|
|
judgeUnitList.Add(judgeUnitBM.ConvertToGameType(attachedGameElement));
|
|
}
|
|
|
|
if (!HaveSameSubmodule)
|
|
{
|
|
this.note.noteJudgeSubmodule = this;
|
|
}
|
|
}
|
|
}
|
|
|
|
public partial class NoteJudgeSubmodule
|
|
{
|
|
public override void SaveBM()
|
|
{
|
|
matchedBM = new NoteJudgeSubmodule_BM(attachedGameElement, this);
|
|
}
|
|
}
|
|
|
|
public partial class NoteJudgeSubmodule
|
|
{
|
|
private static Dictionary<string, NoteJudgeUnit> JudgeUnitCollection(NoteBase note) =>
|
|
new Dictionary<string, NoteJudgeUnit>()
|
|
{
|
|
{ "TouchArea", new TouchAreaJudgeUnit(note, 1000) },
|
|
{ "FullScreenNearTime", new FullScreenNearTimeJudgeUnit(note) },
|
|
{ "TriggerConnect", new TriggerConnectJudgeUnit(note, null) }
|
|
};
|
|
}
|
|
|
|
namespace Beatmap
|
|
{
|
|
public class NoteJudgeSubmodule_BM : Submodule_BM
|
|
{
|
|
public List<NoteJudgeUnit_BM> judgeUnitList;
|
|
|
|
public NoteJudgeSubmodule_BM()
|
|
{
|
|
|
|
}
|
|
|
|
public NoteJudgeSubmodule_BM(GameElement attachedElement, NoteJudgeSubmodule noteJudgeSubmodule) : base(attachedElement)
|
|
{
|
|
judgeUnitList = new List<NoteJudgeUnit_BM>();
|
|
|
|
foreach (var judgeUnit in noteJudgeSubmodule.judgeUnitList)
|
|
{
|
|
judgeUnitList.Add(judgeUnit.ConvertToBM());
|
|
if (judgeUnitList.Count > 1)
|
|
{
|
|
Debug.Log("Multiple judge units found for note: " + attachedElement.elementName);
|
|
}
|
|
}
|
|
}
|
|
|
|
public override void ExecuteBM()
|
|
{
|
|
attachedElement = GameElement_BM.GetElement(attachedElementGuid);
|
|
(attachedElement as NoteBase).noteJudgeSubmodule = new NoteJudgeSubmodule(attachedElement as NoteBase, judgeUnitList);
|
|
}
|
|
}
|
|
}
|
|
} |