Exemple #1
0
        // Ensures that at least one note of the type is present and moves the first note to the start of the beatmap.
        private void ValidateFirstNoteOfType(List <ShowLight> showlights, ShowLightType showlightType)
        {
            int firstNoteIndex = showlights.FindIndex(sl => sl.GetShowLightType() == showlightType);

            if (firstNoteIndex == -1)
            {
                // Add new random note if not found
                showlights.Insert(0,
                                  new ShowLight(FirstBeatTime,
                                                showlightType == ShowLightType.Fog ? FogGenerationFunctions.GetRandomFogNote() : BeamGenerationFunctions.GetRandomBeamNote())
                                  );
            }
            else if (showlights[firstNoteIndex].Time != FirstBeatTime)
            {
                // Move first note to start of the beatmap
                showlights[firstNoteIndex] = new ShowLight(FirstBeatTime, showlights[firstNoteIndex].Note);
            }
        }
Exemple #2
0
 public static ShowLightType GetShowLightType(this ShowLight sl)
 {
     if (sl.IsBeam())
     {
         return(ShowLightType.Beam);
     }
     else if (sl.IsFog())
     {
         return(ShowLightType.Fog);
     }
     else if (sl.Note == ShowLight.LasersOff || sl.Note == ShowLight.LasersOn)
     {
         return(ShowLightType.Laser);
     }
     else
     {
         return(ShowLightType.Undefined);
     }
 }