/// <summary> /// Sprawdzanie pozycji pierwszego elementu z kolekcji oraz odpowiednia obrobka jego /// </summary> public void UpdateButtons(buttonEnum type) { var x = EnumerateList(type); if (x.Count() == 0) { LostCombo(); } else { Button timerButton = getFirstElement(x, type); if (timerButton.buttonPosition.Y < 430 || timerButton.buttonPosition.Y > 520) { LostCombo(); timerButton.CorrectClick = false; } else { Results.AddClick(); AddPoints(); timerButton.CorrectClick = true; } setTimer(timerButton); } }
private IEnumerable <Button> EnumerateList(buttonEnum type) { var x = from files in ButtonInGame where files.buttonPosition.Y <= 600 && files.Type == type && files.active == false select files; return(x); }
internal void AddButton(buttonEnum type, float x) { Button tempButton = new Button() { active = false, Type = type, timeSpawn = MediaPlayer.PlayPosition.Seconds * 1000 + MediaPlayer.PlayPosition.Milliseconds, buttonPosition = new Vector2(x, 40) }; GameButtons.Add(tempButton); ButtonInEditor.Add(tempButton); }
private Button getFirstElement(IEnumerable <Button> x, buttonEnum type) { Button Min = x.First(); if (x.Count() > 1) { for (int i = 1; i < x.Count(); i++) { if (x.ElementAt(i).timeSpawn <= Min.timeSpawn && x.ElementAt(i).Type == type && x.ElementAt(i).buttonPosition.Y >= 450) { Min = x.ElementAt(i); } } } return(Min); }
private IEnumerable<Button> EnumerateList(buttonEnum type) { var x = from files in ButtonInGame where files.buttonPosition.Y <= 600 && files.Type == type && files.active == false select files; return x; }
private Button getFirstElement(IEnumerable<Button> x, buttonEnum type) { Button Min = x.First(); if (x.Count() > 1) for (int i = 1; i < x.Count(); i++) { if (x.ElementAt(i).timeSpawn <= Min.timeSpawn && x.ElementAt(i).Type == type && x.ElementAt(i).buttonPosition.Y >= 450) Min = x.ElementAt(i); } return Min; }