Example #1
0
        private void newButtonClicked(GameButton button)
        {
            Debug.Assert(activeButtons.Count <= 1);
            button.SetVisible(true);

            if (activeButtons.Count == 0)
            {
                activeButtons.Add(button);
            }
            else if (activeButtons.Count == 1)
            {
                if (activeButtons[0] == button)
                {
                    return;
                }
                if (activeButtons[0].Num != button.Num)
                {
                    button.Update();
                    System.Threading.Thread.Sleep(500);
                    activeButtons[0].SetVisible(false);
                    button.SetVisible(false);
                }
                else
                {
                    activeButtons[0].Enabled = false;
                    button.Enabled           = false;
                }
                activeButtons.Clear();
            }
        }