加入测试样例,初步完善队列信息——视图转换

This commit is contained in:
2025-06-12 01:45:01 +08:00
parent 0346ede110
commit 5c20a1e935
24 changed files with 821 additions and 2510 deletions
@@ -8,7 +8,7 @@ public class JudgeManager : MonoBehaviour
private Dictionary<KeyCode, Queue<Note>> judgeQueues = new Dictionary<KeyCode, Queue<Note>>();
private Dictionary<string, bool> startJudgedNotes = new Dictionary<string, bool>();
private Dictionary<string, bool> releasedNotes = new Dictionary<string, bool>();
// 记录 End 段的 scheduledEndTime(防止 End 被回收后仍然能判定)
// 记录 End 段的 scheduledEndTime(防止 End 被回收后仍然能判定)
private Dictionary<string, float> noteEndTimes = new Dictionary<string, float>();
@@ -26,7 +26,7 @@ public class JudgeManager : MonoBehaviour
}
/// <summary>
/// 记录某个颜色的长音符 End 段的 scheduledEndTime
/// 记录某个颜色的长音符 End 段的 scheduledEndTime
/// </summary>
public void RegisterScheduledEndTime(string noteColor, float endTime)
{
@@ -34,7 +34,7 @@ public class JudgeManager : MonoBehaviour
}
/// <summary>
/// 获取某个颜色的 End 段的 scheduledEndTime
/// 获取某个颜色的 End 段的 scheduledEndTime
/// </summary>
public float GetScheduledEndTime(string noteColor)
{
@@ -63,7 +63,7 @@ public class JudgeManager : MonoBehaviour
}
/// <summary>
/// 当音符进入判定区域时调用
/// 当音符进入判定区域时调用
/// </summary>
public void RegisterNote(KeyCode key, Note note)
{
@@ -77,7 +77,7 @@ public class JudgeManager : MonoBehaviour
}
/// <summary>
/// 当音符离开判定区域时调用
/// 当音符离开判定区域时调用
/// </summary>
public void UnregisterNote(KeyCode key, Note note)
{
@@ -93,7 +93,7 @@ public class JudgeManager : MonoBehaviour
}
else
{
// **如果音符未被判定,则触发 Miss**
// **如果音符未被判定,则触发 Miss**
if (!n.IsJudged())
{
n.JudgeMiss();
@@ -104,13 +104,13 @@ public class JudgeManager : MonoBehaviour
}
/// <summary>
/// 按键按下时,判定队列中最早进入的音符
/// 按键按下时,判定队列中最早进入的音符
/// </summary>
public void JudgeEarliestNote(KeyCode key)
{
if (judgeQueues.ContainsKey(key) && judgeQueues[key].Count > 0)
{
Note note = judgeQueues[key].Dequeue(); // 只取最早的音符
Note note = judgeQueues[key].Dequeue(); // 只取最早的音符
if (note != null && !note.IsJudged())
{
note.Judge();