public void ShowlightEqualsTest() { var one = new Showlight { Note = 24, Time = 0.0F }; var two = new Showlight { Note = 24, Time = 1.4F }; var three= new Showlight { Note = 24, Time = 3.0F }; var two1 = new Showlight { Note = 24, Time = 11.4F }; var three1 = new Showlight { Note = 24, Time = 13.0F }; var list = new List<Showlight> { one, two, two1, three, three1 }; var distinct = list.OrderBy(x => x.Time).Union(new List<Showlight> { three, three1, two, two1, one }).ToList(); if (list.Count == distinct.Count) { Assert.Fail(); } }
/* Add to list logic * if (i+1 == List.Count) List.Add(objectToAdd); * else List.Insert(i+1, objectToAdd); */ public List <Showlight> FixShowlights(List <Showlight> ShowlightList) { if (ShowlightList.Count == 0) { return(ShowlightList); } //Setup Stage Fog Color if (ShowlightList[0].Time > 10.0F) { ShowlightList.Insert(0, new Showlight() { Note = getFogNote(ShowlightList[0].Note), Time = 10.0F }); } else if (ShowlightList[0].Note < 24 || ShowlightList[0].Note > 35) { ShowlightList[0].Note = getFogNote(ShowlightList[0].Note); } //Setup Stage lights //Additional fix for stage lights for (var i = 1; i + 1 <= ShowlightList.Count; i++) { //if current is last, add new one n=n t=t+1 if (i + 1 == ShowlightList.Count) { var objectToAdd = new Showlight() { Note = ShowlightList[i].Note, Time = ShowlightList[i].Time + 1 }; ShowlightList.Add(objectToAdd); } if (ShowlightList[i].Note == ShowlightList[i + 1].Note) // if next note is current { ShowlightList.Remove(ShowlightList[i + 1]); } //Fog Color for, every: Solo, every 30% of the song. NO EFFECT. if (ShowlightList[i].Note > 23 && ShowlightList[i].Note < 36) { ShowlightList[i].Note = getBeamNote(ShowlightList[i].Note); continue; } //For all notes > 67 || note in range [36..41] translate it to Beam\spotlight, range [42..59] if (ShowlightList[i].Note < 24 || ShowlightList[i].Note > 35 && ShowlightList[i].Note < 42 || ShowlightList[i].Note > 67) { ShowlightList[i].Note = getBeamNote(ShowlightList[i].Note); continue; } } //Forced laser effect for last note (we probablty couldn't see it) ShowlightList[ShowlightList.Count - 1].Note = 66; return(ShowlightList); }
/* Add to list logic * if (i+1 == List.Count) List.Add(objectToAdd); * else List.Insert(i+1, objectToAdd); */ public List <Showlight> FixShowlights(List <Showlight> ShowlightList) { if (ShowlightList.Count == 0) { return(ShowlightList); } if (ShowlightList[0].Time > 10.0F) { ShowlightList.Insert(0, new Showlight() { Note = getFogNote(ShowlightList[0].Note), Time = 10.0F }); } if (ShowlightList[0].Note < 24 || ShowlightList[0].Note > 35) { ShowlightList[0].Note = getFogNote(ShowlightList[0].Note); } //Additional fix for stage lights for (var i = 1; i + 1 <= ShowlightList.Count; i++) { try { //if current is last, add new one n=66 t=i-1.t if (i + 1 == ShowlightList.Count) { var objectToAdd = new Showlight() { Note = ShowlightList[i].Note, Time = ShowlightList[i].Time + 1 }; ShowlightList.Add(objectToAdd); } if (ShowlightList[i].Note == ShowlightList[i + 1].Note) // if next note is current { ShowlightList.Remove(ShowlightList[i + 1]); } } catch {} //Fog Color for, every: note < 24 replace to its eq from 1 oct if (ShowlightList[i].Note < 24) { ShowlightList[i].Note = getFogNote(ShowlightList[i].Note); continue; } //For all notes > 67 || note in range [36..41] translate it to Beam\spotlight, range [42..59] if (ShowlightList[i].Note > 35 && ShowlightList[i].Note < 42 || ShowlightList[i].Note > 67) { ShowlightList[i].Note = getBeamNote(ShowlightList[i].Note); continue; } } return(ShowlightList); }
public bool FixShowlights(List<Showlight> showlightList) { if (showlightList.Count == 0) return true; //Setup Stage Fog Color if (showlightList[0].Time > 10.0F) { showlightList.Insert(0, new Showlight { Note = GetFogNote(showlightList[0].Note), Time = 10.0F }); } else if (showlightList[0].Note < 24 || showlightList[0].Note > 35) { showlightList[0].Note = GetFogNote(showlightList[0].Note); } //Setup Stage lights //Additional fix for stage lights for (var i = 1; i + 1 <= showlightList.Count; i++) { //if current is last, add new one n=n t=t+1 if (i + 1 == showlightList.Count) { var objectToAdd = new Showlight { Note = showlightList[i].Note, Time = showlightList[i].Time + 1 }; showlightList.Add(objectToAdd); } if (showlightList[i].Note == showlightList[i + 1].Note) // if next note is current showlightList.Remove(showlightList[i + 1]); //Fog Color for, every: Solo, every 30% of the song. NO EFFECT. if (showlightList[i].Note > 23 && showlightList[i].Note < 36) { showlightList[i].Note = GetBeamNote(showlightList[i].Note); continue; } // TODO: notes 42 to 65 range? cause RS1->RS2 in game hangs //For all notes > 67 || note in range [36..41] translate it to Beam\spotlight, range [42..59] if (showlightList[i].Note < 24 || showlightList[i].Note > 35 && showlightList[i].Note < 42 || showlightList[i].Note > 67) { showlightList[i].Note = GetBeamNote(showlightList[i].Note); continue;//useless for now } } //Forced laser effect for last note (we probablty couldn't see it) showlightList[showlightList.Count - 1].Note = 66; return PopShList(showlightList); }
public bool FixShowlights(List <Showlight> showlightList) { if (showlightList.Count == 0) { return(true); } //Setup Stage Fog Color if (showlightList[0].Time > 10.0F) { showlightList.Insert(0, new Showlight { Note = GetFogNote(showlightList[0].Note), Time = 10.0F }); } else if (showlightList[0].Note < 24 || showlightList[0].Note > 35) { showlightList[0].Note = GetFogNote(showlightList[0].Note); } //Setup Stage lights //Additional fix for stage lights for (var i = 1; i + 1 <= showlightList.Count; i++) { //if current is last, add new one n=n t=t+1 if (i + 1 == showlightList.Count) { var objectToAdd = new Showlight { Note = showlightList[i].Note, Time = showlightList[i].Time + 1 }; showlightList.Add(objectToAdd); } if (showlightList[i].Note == showlightList[i + 1].Note) // if next note is current { showlightList.Remove(showlightList[i + 1]); } //Fog Color for, every: Solo, every 30% of the song. NO EFFECT. if (showlightList[i].Note > 23 && showlightList[i].Note < 36) { showlightList[i].Note = GetBeamNote(showlightList[i].Note); continue; } // TODO: notes 42 to 65 range? cause RS1->RS2 in game hangs //For all notes > 67 || note in range [36..41] translate it to Beam\spotlight, range [42..59] if (showlightList[i].Note < 24 || showlightList[i].Note > 35 && showlightList[i].Note < 42 || showlightList[i].Note > 67) { showlightList[i].Note = GetBeamNote(showlightList[i].Note); continue;//useless for now } } //Forced laser effect for last note (we probablty couldn't see it) showlightList[showlightList.Count - 1].Note = 66; return(PopShList(showlightList)); }