Beispiel #1
0
            public override void Run()
            {
                LLKScreen screen = (LLKScreen)StaticCurrentSceen;
                Grid      prev   = null;

                for (int j = 0; j < v.Count; j++)
                {
                    prev = (Grid)v.Poll();
                    prev.SetVisible(true);
                    v.Add(prev);
                    try
                    {
                        Sleep(20L);
                    }
                    catch (Exception)
                    {
                    }
                }
                Grid current = prev;

                prev = (Grid)v.Poll();
                while (!v.IsEmpty())
                {
                    Grid o = (Grid)v.Poll();
                    o.SetVisible(false);
                    try
                    {
                        Sleep(20L);
                    }
                    catch (Exception)
                    {
                    }
                }
                prev.SetVisible(false);
                current.SetVisible(false);
                current.SetImage(screen.GetImage(9));
                prev.SetImage(screen.GetImage(9));
                current.SetBorder(1);
                prev.SetBorder(1);
                if (!screen.FindPair())
                {
                    screen.Refreshs();
                }
            }
Beispiel #2
0
            public void Run()
            {
                LLKScreen s = (LLKScreen)StaticCurrentSceen;

                Grid current = null;

                try {
                    if (s.prev != null)
                    {
                        s.prev.SetBorder(3);
                    }

                    if (s.prev == null)
                    {
                        s.prev = s.GetGrid(s.GetTouchX(), s.GetTouchY());
                        if (s.prev != null)
                        {
                            s.prev.SetBorder(0);
                        }
                    }
                    else
                    {
                        if (s.progress.GetValue() == 0)
                        {
                            return;
                        }

                        current = s.GetGrid(s.GetTouchX(), s.GetTouchY());
                        if (current == s.prev)
                        {
                            return;
                        }
                        if (current == null)
                        {
                            s.prev = null;
                        }
                        if (s.prev == null)
                        {
                            return;
                        }
                        if (current.Equals(s.prev))
                        {
                            if (!s.FindPair())
                            {
                                s.Refreshs();
                            }
                            s.pcount = s.FindPath(s.prev, current);
                            if (s.pcount != 0)
                            {
                                s.DeletePair(s.prev, current);
                                s.prev = null;
                                return;
                            }
                        }
                        s.prev.SetBorder(1);
                        s.prev = current;
                        s.prev.SetBorder(0);
                        if (!s.FindPair())
                        {
                            s.Refreshs();
                        }
                    }
                } catch (Exception) {
                    if (s.prev != null)
                    {
                        s.prev.SetBorder(3);
                    }
                    if (current != null)
                    {
                        current.SetBorder(3);
                    }
                }
            }
Beispiel #3
0
            public void DownClick(LComponent comp, float x, float y)
            {
                if (comp.Tag is Screen)
                {
                    LLKScreen screen = (LLKScreen)comp.Tag;
                    LSelect   select = (LSelect)comp;

                    switch (select.GetResultIndex())
                    {
                    case 0:
                        screen.mes.SetVisible(true);
                        if (screen.refreshcount > 0)
                        {
                            screen.mes.SetMessage(EASY_MES);
                            screen.Refreshs();
                        }
                        else
                        {
                            screen.mes.SetMessage(SORRY1_MES);
                        }
                        screen.Remove(select);
                        break;

                    case 1:
                        screen.mes.SetVisible(true);
                        if (screen.tipcount > 0)
                        {
                            screen.mes.SetMessage(EASY_MES);
                            screen.ShowNext();
                        }
                        else
                        {
                            screen.mes.SetMessage(SORRY2_MES);
                        }
                        screen.Remove(select);
                        break;

                    case 2:
                        screen.mes.SetVisible(true);
                        if (screen.bombcount > 0)
                        {
                            screen.mes.SetMessage(EASY_MES);
                            screen.UseBomb();
                        }
                        else
                        {
                            screen.mes.SetMessage(SORRY3_MES);
                        }
                        screen.Remove(select);
                        break;

                    case 3:
                        screen.mes.SetVisible(true);
                        screen.Remove(select);
                        screen.mes.SetVisible(false);
                        screen.role.SetVisible(false);
                        screen.helpRole.SetVisible(true);
                        if (screen.stage != null)
                        {
                            screen.stage.SetVisible(true);
                        }
                        break;

                    default:
                        break;
                    }
                }
            }