Skip to content

Commit ec328b3

Browse files
authored
Merge pull request #554 from Caeden117/dev
Stable (CM 0.11.793)
2 parents 5fd3ac6 + fd7d148 commit ec328b3

File tree

196 files changed

+5646
-6129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+5646
-6129
lines changed

Assets/Tests/ArcTest.cs

Lines changed: 52 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,16 @@ public void CreateArc()
4343
var root = notesContainer.transform.root;
4444
var notePlacement = root.GetComponentInChildren<NotePlacement>();
4545

46-
BaseNote baseNoteA = new V3ColorNote(2f, (int)GridX.Left, (int)GridY.Base, (int)NoteType.Red,
47-
(int)NoteCutDirection.Down);
48-
BaseNote baseNoteB = new V3ColorNote(3f, (int)GridX.Left, (int)GridY.Upper, (int)NoteType.Red,
49-
(int)NoteCutDirection.Up);
46+
BaseNote baseNoteA = new BaseNote
47+
{
48+
JsonTime = 2f, PosX = (int)GridX.Left, PosY = (int)GridY.Base, Type = (int)NoteType.Red,
49+
CutDirection = (int)NoteCutDirection.Down
50+
};
51+
BaseNote baseNoteB = new BaseNote
52+
{
53+
JsonTime = 3f, PosX = (int)GridX.Left, PosY = (int)GridY.Upper, Type = (int)NoteType.Red,
54+
CutDirection = (int)NoteCutDirection.Up
55+
};
5056
PlaceUtils.PlaceNote(notePlacement, baseNoteA);
5157
PlaceUtils.PlaceNote(notePlacement, baseNoteB);
5258

@@ -87,7 +93,7 @@ public void CreateArcWithCoordinates()
8793
var headCustomData = new JSONObject { ["coordinates"] = headCoordinates };
8894
var tailCustomData = new JSONObject { ["coordinates"] = tailCoordinates };
8995

90-
var arcCustomData = new JSONObject
96+
var expectedArcCustomData = new JSONObject
9197
{
9298
["coordinates"] = headCoordinates,
9399
["tailCoordinates"] = tailCoordinates
@@ -99,11 +105,17 @@ public void CreateArcWithCoordinates()
99105
var root = notesContainer.transform.root;
100106
var notePlacement = root.GetComponentInChildren<NotePlacement>();
101107

102-
BaseNote baseNoteA = new V3ColorNote(2f, (int)GridX.Left, (int)GridY.Base, (int)NoteType.Red,
103-
(int)NoteCutDirection.Down, headCustomData);
108+
BaseNote baseNoteA = new BaseNote
109+
{
110+
JsonTime = 2f, PosX = (int)GridX.Left, PosY = (int)GridY.Base, Type = (int)NoteType.Red,
111+
CutDirection = (int)NoteCutDirection.Down, CustomData = headCustomData
112+
};
104113

105-
BaseNote baseNoteB = new V3ColorNote(3f, (int)GridX.Left, (int)GridY.Upper, (int)NoteType.Red,
106-
(int)NoteCutDirection.Up, tailCustomData);
114+
BaseNote baseNoteB = new BaseNote
115+
{
116+
JsonTime = 3f, PosX = (int)GridX.Left, PosY = (int)GridY.Upper, Type = (int)NoteType.Red,
117+
CutDirection = (int)NoteCutDirection.Up, CustomData = tailCustomData
118+
};
107119

108120
PlaceUtils.PlaceNote(notePlacement, baseNoteA);
109121
PlaceUtils.PlaceNote(notePlacement, baseNoteB);
@@ -132,7 +144,7 @@ public void CreateArcWithCoordinates()
132144

133145
CheckUtils.CheckArc("Check generated arc", arcsContainer, 0, 2f, (int)GridX.Left, (int)GridY.Base,
134146
(int)NoteColor.Red, (int)NoteCutDirection.Down, 0, 1, 3f, (int)GridX.Left, (int)GridY.Upper,
135-
(int)NoteCutDirection.Up, 1, 0, arcCustomData);
147+
(int)NoteCutDirection.Up, 1, 0, expectedArcCustomData);
136148
}
137149
}
138150

@@ -147,9 +159,21 @@ public void InvertArc()
147159
var arcPlacement = root.GetComponentInChildren<ArcPlacement>();
148160
var inputController = root.GetComponentInChildren<BeatmapArcInputController>();
149161

150-
BaseArc baseArc = new V3Arc(2f, (int)GridX.Left, (int)GridY.Base, (int)NoteColor.Red,
151-
(int)NoteCutDirection.Left, 0, 1f, 3f, (int)GridX.Left, (int)GridY.Base, (int)NoteCutDirection.Left,
152-
1f, 0);
162+
BaseArc baseArc = new BaseArc
163+
{
164+
JsonTime = 2f,
165+
PosX = (int)GridX.Left,
166+
PosY = (int)GridY.Base,
167+
Color = (int)NoteColor.Red,
168+
CutDirection = (int)NoteCutDirection.Left,
169+
HeadControlPointLengthMultiplier = 1f,
170+
TailJsonTime = 3f,
171+
TailPosX = (int)GridX.Left,
172+
TailPosY = (int)GridY.Base,
173+
TailCutDirection = (int)NoteCutDirection.Left,
174+
TailControlPointLengthMultiplier = 1f,
175+
MidAnchorMode = 0
176+
};
153177
PlaceUtils.PlaceArc(arcPlacement, baseArc);
154178

155179
if (arcsContainer.LoadedContainers[baseArc] is ArcContainer containerA)
@@ -179,9 +203,21 @@ public void UpdateArcMultiplier()
179203
var arcPlacement = root.GetComponentInChildren<ArcPlacement>();
180204
var inputController = root.GetComponentInChildren<BeatmapArcInputController>();
181205

182-
BaseArc baseArc = new V3Arc(2f, (int)GridX.Left, (int)GridY.Base, (int)NoteColor.Red,
183-
(int)NoteCutDirection.Left, 0, 1f, 3f, (int)GridX.Left, (int)GridY.Base, (int)NoteCutDirection.Left,
184-
1f, 0);
206+
BaseArc baseArc = new BaseArc
207+
{
208+
JsonTime = 2f,
209+
PosX = (int)GridX.Left,
210+
PosY = (int)GridY.Base,
211+
Color = (int)NoteColor.Red,
212+
CutDirection = (int)NoteCutDirection.Left,
213+
HeadControlPointLengthMultiplier = 1f,
214+
TailJsonTime = 3f,
215+
TailPosX = (int)GridX.Left,
216+
TailPosY = (int)GridY.Base,
217+
TailCutDirection = (int)NoteCutDirection.Left,
218+
TailControlPointLengthMultiplier = 1f,
219+
MidAnchorMode = 0
220+
};
185221
PlaceUtils.PlaceArc(arcPlacement, baseArc);
186222

187223
if (arcsContainer.LoadedContainers[baseArc] is ArcContainer containerA)

Assets/Tests/BPMTest.cs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ public void SongBpmTimes()
5151
var bpmCollection = BeatmapObjectContainerCollection.GetCollectionForType<BPMChangeGridContainer>(ObjectType.BpmChange);
5252

5353
var songBpm = BeatSaberSongContainer.Instance.Song.BeatsPerMinute;
54-
BaseBpmEvent baseBpmEvent = new V3BpmEvent(0, 111);
54+
var baseBpmEvent = new BaseBpmEvent(0, 111);
5555
bpmCollection.SpawnObject(baseBpmEvent);
5656

57-
baseBpmEvent = new V3BpmEvent(1, 222);
57+
baseBpmEvent = new BaseBpmEvent(1, 222);
5858
bpmCollection.SpawnObject(baseBpmEvent);
5959

60-
baseBpmEvent = new V3BpmEvent(2, 333);
60+
baseBpmEvent = new BaseBpmEvent(2, 333);
6161
bpmCollection.SpawnObject(baseBpmEvent);
6262

63-
baseBpmEvent = new V3BpmEvent(3, 444);
63+
baseBpmEvent = new BaseBpmEvent(3, 444);
6464
bpmCollection.SpawnObject(baseBpmEvent);
6565

6666
Assert.AreEqual(4, bpmCollection.MapObjects.Count);
@@ -69,7 +69,7 @@ public void SongBpmTimes()
6969
CheckBPM("3rd BPM values", bpmCollection, 2, 2, 333, songBpm / 111 + songBpm / 222);
7070
CheckBPM("4th BPM values", bpmCollection, 3, 3, 444, songBpm / 111 + songBpm / 222 + songBpm / 333);
7171

72-
baseBpmEvent = new V3BpmEvent(0, 1);
72+
baseBpmEvent = new BaseBpmEvent(0, 1);
7373
bpmCollection.SpawnObject(baseBpmEvent);
7474

7575
Assert.AreEqual(4, bpmCollection.MapObjects.Count);
@@ -92,10 +92,10 @@ public void ModifyEvent()
9292
var actionContainer = Object.FindObjectOfType<BeatmapActionContainer>();
9393
var bpmCollection = BeatmapObjectContainerCollection.GetCollectionForType<BPMChangeGridContainer>(ObjectType.BpmChange);
9494

95-
BaseBpmEvent baseBpmEvent = new V3BpmEvent(20, 20);
95+
BaseBpmEvent baseBpmEvent = new BaseBpmEvent(20, 20);
9696
bpmCollection.SpawnObject(baseBpmEvent);
9797

98-
baseBpmEvent = new V3BpmEvent(10, 10);
98+
baseBpmEvent = new BaseBpmEvent(10, 10);
9999
bpmCollection.SpawnObject(baseBpmEvent);
100100

101101
if (bpmCollection.LoadedContainers[baseBpmEvent] is BpmEventContainer container)
@@ -124,10 +124,10 @@ public void GoToBeat()
124124
var bpmCollection = BeatmapObjectContainerCollection.GetCollectionForType<BPMChangeGridContainer>(ObjectType.BpmChange);
125125

126126
var songBpm = BeatSaberSongContainer.Instance.Song.BeatsPerMinute;
127-
BaseBpmEvent baseBpmEvent = new V3BpmEvent(0, 111);
127+
BaseBpmEvent baseBpmEvent = new BaseBpmEvent(0, 111);
128128
bpmCollection.SpawnObject(baseBpmEvent);
129129

130-
baseBpmEvent = new V3BpmEvent(1, 222);
130+
baseBpmEvent = new BaseBpmEvent(1, 222);
131131
bpmCollection.SpawnObject(baseBpmEvent);
132132

133133
Assert.AreEqual(2, bpmCollection.MapObjects.Count);
@@ -162,13 +162,13 @@ public void UndoActionCollection()
162162
var bpmCollection = BeatmapObjectContainerCollection.GetCollectionForType<BPMChangeGridContainer>(ObjectType.BpmChange);
163163

164164
var songBpm = BeatSaberSongContainer.Instance.Song.BeatsPerMinute;
165-
var baseBpmEvent0 = new V3BpmEvent(0, 111);
165+
var baseBpmEvent0 = new BaseBpmEvent(0, 111);
166166
bpmCollection.SpawnObject(baseBpmEvent0, out var conflicting0);
167167

168-
var baseBpmEvent1 = new V3BpmEvent(1, 222);
168+
var baseBpmEvent1 = new BaseBpmEvent(1, 222);
169169
bpmCollection.SpawnObject(baseBpmEvent1, out var conflicting1);
170170

171-
var baseBpmEvent2 = new V3BpmEvent(2, 333);
171+
var baseBpmEvent2 = new BaseBpmEvent(2, 333);
172172
bpmCollection.SpawnObject(baseBpmEvent2, out var conflicting2);
173173

174174
BeatmapActionContainer.AddAction(new ActionCollectionAction(new List<BeatmapAction>{

Assets/Tests/BeatmapActionTest.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void ModifiedAction()
3737
var notesContainer = BeatmapObjectContainerCollection.GetCollectionForType<NoteGridContainer>(ObjectType.Note);
3838
var root = notesContainer.transform.root;
3939

40-
BaseNote baseNoteA = new V3ColorNote
40+
BaseNote baseNoteA = new BaseNote
4141
{
4242
JsonTime = 2,
4343
Type = (int)NoteType.Red
@@ -70,12 +70,12 @@ public void CompositeTest()
7070
var selectionController = root.GetComponentInChildren<SelectionController>();
7171
var notePlacement = root.GetComponentInChildren<NotePlacement>();
7272

73-
BaseNote baseNoteA = new V3ColorNote
73+
BaseNote baseNoteA = new BaseNote
7474
{
7575
JsonTime = 2,
7676
Type = (int)NoteType.Red
7777
};
78-
BaseNote baseNoteB = new V3ColorNote
78+
BaseNote baseNoteB = new BaseNote
7979
{
8080
JsonTime = 2,
8181
Type = (int)NoteType.Blue,
@@ -185,12 +185,12 @@ public void ModifiedWithConflictingAction()
185185
var root = notesContainer.transform.root;
186186
var notePlacement = root.GetComponentInChildren<NotePlacement>();
187187

188-
PlaceUtils.PlaceNote(notePlacement, new V3ColorNote
188+
PlaceUtils.PlaceNote(notePlacement, new BaseNote
189189
{
190190
JsonTime = 2,
191191
Type = (int)NoteType.Red
192192
});
193-
PlaceUtils.PlaceNote(notePlacement, new V3ColorNote
193+
PlaceUtils.PlaceNote(notePlacement, new BaseNote
194194
{
195195
JsonTime = 2,
196196
Type = (int)NoteType.Blue

0 commit comments

Comments
 (0)