コード例 #1
0
ファイル: MenuItem.cs プロジェクト: scruffynerf/Fractalscape
        public void Select()
        {
            var newMenuType = Menu.Type.Download;
            var menu        = WindowManager.Instance.GetWindow <Menu>(WindowNames.Menu);

            if (Menu.IsItemOpen(Name))
            {
                Menu.GetOpenItem(Name);
            }
            else
            {
                if (FractalLog.Contains(AppSession.DownloadedFractals, Fractal.Name))
                {
                    newMenuType = Menu.Type.View;
                }
                else if ((Cost <= 0 || PurchaseRequest.Purchased(Fractal.Name)) && AppSession.IsConnectedToInternet)
                {
                    newMenuType = Menu.Type.Download;
                }
                else if (Cost > 0 && AppSession.IsConnectedToInternet)
                {
                    newMenuType = Menu.Type.Purchase;
                }
                else if (!AppSession.IsConnectedToInternet)
                {
                    WindowManager.Instance.ChangeWindow(WindowNames.OfflineWindow);
                    return;
                }
                WindowManager.Instance.ChangeWindow(menu.gameObject);
                menu.Setup(this, newMenuType);
            }
        }
コード例 #2
0
        private static List <Fractal>[] ListIntersection(List <Fractal> l1, List <Fractal> l2)
        {
            var newL1 = new List <Fractal>(); //Where l2 is a subset of l1
            var newL2 = new List <Fractal>();

            Debug.Log(l1);
            Debug.Log(l2);

            for (var i = 0; i < l1.Count; i++)
            {
                if (FractalLog.Contains(l2, l1[i].Name))
                {
                    newL2.Add(l1[i]);
                }
                else
                {
                    newL1.Add(l1[i]);
                }
            }
            Debug.Log(l1.Count);
            Debug.Log(l2.Count);
            return(new[] { newL1, newL2 });
        }