Example #1
0
        /// <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);
            }
        }
Example #2
0
        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);
        }
Example #3
0
 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);
 }
Example #4
0
        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);
        }
Example #5
0
        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);
        }
Example #6
0
 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;
 }
Example #7
0
 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;
 }
Example #8
0
 /// <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);
     }
 }