Skip to content

Commit a7f9dee

Browse files
committed
updated battledirector to pull the note from queue
1 parent 3b79813 commit a7f9dee

2 files changed

Lines changed: 19 additions & 5 deletions

File tree

scenes/BattleDirector/scripts/BattleDirector.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,22 @@ public partial class BattleDirector : Node2D
3232

3333
private SongData _curSong;
3434

35+
[Export]
36+
private NoteQueue NQ;
37+
3538
#endregion
3639

3740
#region Note Handling
3841
private void PlayerAddNote(ArrowType type, int beat)
3942
{
43+
//TODO: note that should be added from the queue
44+
Note note = NQ.GetCurrentNote();
45+
if (note == null)
46+
{
47+
GD.Print("No notes in queue");
48+
return;
49+
}
50+
4051
GD.Print($"Player trying to place {type} typed note at beat: " + beat);
4152
if (!NotePlacementBar.CanPlaceNote())
4253
return;

scenes/CustomNotes/NoteQueue.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,17 @@ public Note GetCurrentNote()
8585
{
8686
if (_noteQueue.Count > 0)
8787
{
88-
Note currentNote = _noteQueue.Dequeue();
89-
UpdateQueue();
90-
return currentNote;
88+
return _noteQueue.Peek();
9189
}
9290
return null;
9391
}
9492

93+
public void DequeueNote()
94+
{
95+
_noteQueue.Dequeue();
96+
UpdateQueue();
97+
}
98+
9599
// Updates the queue's graphics
96100
private void UpdateQueue()
97101
{
@@ -131,6 +135,5 @@ public void ScrambleQueue()
131135
_noteQueue = new Queue<Note>(tempList);
132136
}
133137

134-
//TODO: should work, in order to run in game use
135-
// noteQueueInstance.AddNoteToQueue("single");
138+
//TODO: MAYBE? implement saving the notequeue to savedata
136139
}

0 commit comments

Comments
 (0)