Exemplo n.º 1
0
 public CCRuntimeException(CCObject stack, CCObject env, CCObject code, CCObject dump)
 {
     Stack = stack;
     Env = env;
     Code = code;
     Dump = dump;
 }
        public void nextCallback(CCObject pSender)
        {
            CCScene s = new EffectAdvanceScene();

            s.addChild(EffectAdvanceScene.nextEffectAdvanceAction());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 3
0
        public void menuCallback(CCObject pSender)
        {
            CCMenuItemFont pItem  = (CCMenuItemFont)pSender;
            int            nIndex = pItem.zOrder - PerformanceTestScene.kItemTagBasic;

            switch (nIndex)
            {
            case 0:
                PerformanceNodeChildrenTest.runNodeChildrenTest();
                break;

            case 1:
                PerformanceParticleTest.runParticleTest();
                break;

            case 2:
                PerformanceSpriteTest.runSpriteTest();
                break;

            case 3:
                PerformanceTextureTest.runTextureTest();
                break;

            case 4:
                PerformanceTouchesTest.runTouchesTest();
                break;

            default:
                break;
            }
        }
Exemplo n.º 4
0
        public void backCallback(CCObject pSender)
        {
            CCDirector.sharedDirector().enableRetinaDisplay(false);
            BugsTestScene pScene = new BugsTestScene();

            pScene.runThisTest();
        }
Exemplo n.º 5
0
        public TMXOrthoTest2()
        {
            CCTMXTiledMap map = CCTMXTiledMap.tiledMapWithTMXFile("TileMaps/orthogonal-test1");

            addChild(map, 0, TileMapTestScene.kTagTileMap);

            CCSize s = map.contentSize;
            ////----UXLOG("ContentSize: %f, %f", s.width,s.height);

            List <CCNode>     pChildrenArray = map.children;
            CCSpriteBatchNode child          = null;
            CCObject          pObject        = null;

            if (pChildrenArray != null && pChildrenArray.Count > 0)
            {
                for (int i = 0; i < pChildrenArray.Count; i++)
                {
                    pObject = pChildrenArray[i];
                    child   = (CCSpriteBatchNode)pObject;

                    if (child == null)
                    {
                        break;
                    }

                    //child.Texture.setAntiAliasTexParameters();
                }
            }
            map.runAction(CCScaleBy.actionWithDuration(2, 0.5f));
        }
Exemplo n.º 6
0
        public void backCallback(CCObject pSender)
        {
            CCScene s = new ActionManagerTestScene();

            s.addChild(backActionManagerAction());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 7
0
        public void nextCallback(CCObject pSender)
        {
            CCScene s = new TileMapTestScene();

            s.addChild(TileMapTestScene.nextTileMapAction());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 8
0
        public void backCallback(CCObject pSender)
        {
            CCScene s = ZwoptexTestScene.node();

            s.addChild(backZwoptexTest());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 9
0
        public List <CMDBColumn> GetTableColumns(CCObject ccObject)
        {
            List <CMDBColumn> columns = new List <CMDBColumn>();

            if (_cache.TryGetValue($"GetTableColumns.{ccObject.Table}", out columns))
            {
                var cacheEntryOptions = new MemoryCacheEntryOptions()
                                        .SetSlidingExpiration(TimeSpan.FromMinutes(10));

                string query = @"
                    SELECT col.name AS 'ColumnName'
		                    ,typ.name as 'ColumnType'
                        from sys.columns col
                            join sys.types typ on
                                col.system_type_id = typ.system_type_id AND col.user_type_id = typ.user_type_id
                        where object_id = object_id(@tableName)
                ";
                Dictionary <string, object> Params = new Dictionary <string, object>();
                Params.Add("tableName", ccObject.Table);
                var results = _ccSQL.ExecuteQuery(query, Params).Results;
                foreach (var result in results)
                {
                    var cmDBColumn = new CMDBColumn();
                    cmDBColumn.ColumnName = result[0].ToString();
                    cmDBColumn.ColumnType = result[1].ToString();
                    columns.Add(cmDBColumn);
                }

                _cache.Set($"GetTableColumns.{ccObject.Table}", columns, cacheEntryOptions);
            }
            return(columns);
        }
Exemplo n.º 10
0
        public void backCallback(CCObject pSender)
        {
            CCScene s = new TextureTestScene();

            s.addChild(TextureTestScene.backTextureTest());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 11
0
        public void backCallback(CCObject pSender)
        {
            CCScene s = new EaseActionsTestScene();

            s.addChild(EaseTest.backEaseAction());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 12
0
        public void backCallback(CCObject pSender)
        {
            CCScene s = new LayerTestScene();

            s.addChild(LayerTestScene.backTestAction());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 13
0
        public void restartCallback(CCObject pSender)
        {
            CCScene s = new MotionStreakTestScene();//CCScene::node();

            s.addChild(restartMotionAction());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 14
0
        private void NameInput(CCObject p_Sender)
        {
            IAsyncResult result = Guide.BeginShowKeyboardInput(PlayerIndex.One, sipTitle, sipDescription,
                                                               sipResult, UserInputCallBack, new object());

            m_Image = p_Sender as CCMenuItemImage;
        }
Exemplo n.º 15
0
        public void restartCallback(CCObject pSender)
        {
            CCScene s = new DirectorTestScene();

            s.addChild(restartDirectorTestCase());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 16
0
        public void backCallback(CCObject pSender)
        {
            CCScene s = new ParallaxTestScene();

            s.addChild(ParallaxTestScene.backParallaxAction());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 17
0
        public void nextCallback(CCObject pSender)
        {
            CCScene s = new SpriteTestScene();

            s.addChild(SpriteTestScene.nextSpriteTestAction());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 18
0
        public void testNCallback(CCObject pSender)
        {
            subtestNumber = ((CCMenuItemFont)pSender).tag;
            SpriteMenuLayer pMenu = (SpriteMenuLayer)getChildByTag(PerformanceSpriteTest.kTagMenuLayer);

            pMenu.restartCallback(pSender);
        }
Exemplo n.º 19
0
        public void backCallback(CCObject pSender)
        {
            CCScene s = new CocosNodeTestScene();//CCScene.node();

            s.addChild(CocosNodeTestScene.backCocosNodeAction());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 20
0
        public void restartCallback(CCObject pSender)
        {
            CCScene s = new ActionsTestScene();

            s.addChild(ActionsTestScene.RestartAction());
            CCDirector.sharedDirector().replaceScene(s);
        }
Exemplo n.º 21
0
        public virtual void nextCallback(CCObject pSender)
        {
            m_nCurCase++;
            m_nCurCase = m_nCurCase % m_nMaxCases;

            showCurrentTest();
        }
Exemplo n.º 22
0
 public void menuCallbackDisabled(CCObject pSender)
 {
     // hijack all touch events for 5 seconds
     CCTouchDispatcher.sharedDispatcher().setPriority(-128 - 1, this);
     base.schedule(this.allowTouches, 5.0f);
     Debug.WriteLine("TOUCHES DISABLED FOR 5 SECONDS");
 }
        public void backCallback(CCObject pSender)
        {
            CCScene s = new RenderTextureScene();

            s.addChild(RenderTextureScene.backTestCase());
            CCDirector.sharedDirector().replaceScene(s);
            //s->release();
        }
Exemplo n.º 24
0
        public virtual void MainMenuCallback(CCObject pSender)
        {
            CCScene pScene = CCScene.node();
            CCLayer pLayer = new TestController();

            pScene.addChild(pLayer);
            CCDirector.sharedDirector().replaceScene(pScene);
        }
Exemplo n.º 25
0
        public void backCallback(CCObject pSender)
        {
            CCScene s = new ProgressActionsTestScene();

            s.addChild(ProgressActionsTestScene.backAction());
            CCDirector.sharedDirector().replaceScene(s);
            //s->release();
        }
Exemplo n.º 26
0
        public void testNCallback(CCObject pSender)
        {
            subtestNumber = ((CCNode)pSender).tag;

            ParticleMenuLayer pMenu = (ParticleMenuLayer)getChildByTag(PerformanceParticleTest.kTagMenuLayer);

            pMenu.restartCallback(pSender);
        }
Exemplo n.º 27
0
        public void restartCallback(CCObject pSender)
        {
            CCScene pScene = new SchedulerTestScene();
            CCLayer pLayer = SchedulerTestScene.restartSchedulerTest();

            pScene.addChild(pLayer);
            CCDirector.sharedDirector().replaceScene(pScene);
        }
Exemplo n.º 28
0
        public void onPushScene(CCObject pSender)
        {
            CCScene scene  = new SceneTestScene();
            CCLayer pLayer = new SceneTestLayer2();

            scene.addChild(pLayer, 0);
            CCDirector.sharedDirector().pushScene(scene);
        }
Exemplo n.º 29
0
        public void onReplaceScene(CCObject pSender)
        {
            CCScene pScene = new SceneTestScene();
            CCLayer pLayer = new SceneTestLayer3();

            pScene.addChild(pLayer, 0);
            CCDirector.sharedDirector().replaceScene(pScene);
        }
Exemplo n.º 30
0
        public void onReplaceSceneTran(CCObject pSender)
        {
            CCScene pScene = new SceneTestScene();
            CCLayer pLayer = new SceneTestLayer3();

            pScene.addChild(pLayer, 0);
            CCDirector.sharedDirector().replaceScene(pScene);
            //(CCTransitionFlipX.transitionWithDuration(2, pScene));
        }
Exemplo n.º 31
0
        private void AddImageClick(CCObject p_Sender)
        {
#if WINPHONE
            PhotoChooserTask photoChooserTask = new PhotoChooserTask();
            photoChooserTask.Completed += SelectPictureComplete;
            photoChooserTask.ShowCamera = true;
            photoChooserTask.Show();
#endif
        }
Exemplo n.º 32
0
 private CCObject CompileLambda(CCObject body, CCCons env, CCObject cont)
 {
     return new CCCons(
         new CCIS("LDF"), new CCCons(
             Compile1(body, env, new CCCons(new CCIS("RTN"), null)),
             cont));
 }
Exemplo n.º 33
0
        public CCObject Compile(CCObject obj)
        {
            var cont = new CCCons(new CCIS("HALT"), null);

            return Compile1(obj, root_env, cont);
        }
Exemplo n.º 34
0
 private CCObject CompileList(CCObject args, CCCons env, CCObject cont)
 {
     if (args == null)
     {
         return cont;
     }
     else
     {
         return CompileList((args as CCCons).cdr, env, Compile1((args as CCCons).car, env, new CCCons(new CCIS("CONS"), cont)));
     }
 }
Exemplo n.º 35
0
 public CCZone(CCObject obj)
 {
     this.m_pCopyObject = obj;
 }
Exemplo n.º 36
0
        private CCObject Compile1(CCObject exp, CCCons env, CCObject cont)
        {
            if (exp == null)    // nil
            {
                return new CCCons(null, cont);
            }
            else if (exp.GetType() != typeof(CCCons)) // number, string or identifier
            {
                if (exp.GetType() == typeof(CCInt) || exp.GetType() == typeof(CCString))
                {
                    return new CCCons(new CCIS("LDC"), new CCCons(exp, cont));
                }
                else // identifier
                {
                    var ij = Index(exp as CCIdentifier, env);
                    if (ij == null)
                    {
                        throw new CCCompileIdentifierNotFoundException(exp.ToString());
                    }
                    else
                    {
                        if (ij.cdr.GetType() == typeof(CCCons)) // parameter with additional information
                        {
                            if (ij.caddr.ToString() == "&rest")  // rest parameter
                            {
                                ij.cdr = ij.cadr;  // variable position
                                return new CCCons(new CCIS("LDR"), new CCCons(ij, cont));
                            }
                            else
                            {
                                throw new CCCompileInvalidFormalParameterException(ij.caddr.ToString());
                            }
                        }
                        else
                        {
                            return new CCCons(new CCIS("LD"), new CCCons(ij, cont));
                        }
                    }
                }
            }
            else // apply
            {
                var expc = exp as CCCons;
                var fcn = expc.car;
                var args = expc.cdr;
                if (fcn.GetType() != typeof(CCCons)) // apply function is a builtin, lambda or special form
                {
                    var fn = fcn as CCIdentifier;
                    var name = from x in CCVM.Builtin where x == fn.Name select x;
                    if (name.Count() == 1)  // builtin
                    {
                        if (name.First() == "list")
                        {
                            return new CCCons(null, CompileList(args, env, cont));
                        }
                        else
                        {
                            return CompileBuiltin(args, env, new CCCons(fcn, cont));
                        }
                    }
                    else if (fn.Name == "fn") // lambda special form
                    {
                        var argsc = args as CCCons;
                        return CompileLambda(argsc.cadr, new CCCons(argsc.car, env), cont);
                    }
                    else if (fn.Name == "if") // if special form
                    {
                        var argsc = args as CCCons;
                        return CompileIf(argsc.car, argsc.cadr, argsc.caddr, env, cont);
                    }
                    else if (fn.Name == "let" || fn.Name == "letrec") // let or letrec
                    {
                        var argsc = args as CCCons;

                        var newn = new CCCons(argsc.car, env);
                        var values = argsc.cadr;
                        var body = argsc.caddr;

                        if (fn.Name == "let") // let
                        {
                            return new CCCons(null, CompileApp(values as CCCons, env, CompileLambda(body, newn, new CCCons(new CCIS("AP"), cont))));
                        }
                        else // letrec
                        {
                            return new CCCons(new CCIS("DUM"), new CCCons(null, CompileApp(values as CCCons, newn, CompileLambda(body, newn, new CCCons(new CCIS("RAP"), cont)))));
                        }
                    }
                    else if (fn.Name == "quote")    // quote
                    {
                        return new CCCons(new CCIS("LDC"), new CCCons((args as CCCons).car, cont));
                    }
                    else if(fn.Name == "set")    // setf
                    {
                        var argsc = args as CCCons;

                        var symbol = argsc.car as CCIdentifier;
                        var value = argsc.cadr;

                        var pos = Index(symbol, env);
                        if (pos == null)
                        {
                            // create new symbol(root environment)
                            CCCons i = fn_symbols;
                            while (i.cdr != null)
                                i = i.cdr as CCCons;

                            if (i.car == null)
                            {
                                i.car = symbol;
                            }
                            else
                            {
                                var cons = new CCCons(symbol, null);
                                i.cdr = cons;
                            }

                            // re-find index
                            pos = Index(symbol, env);
                        }

                        return Compile1(value, env, new CCCons(new CCIS("ST"), new CCCons(pos, cont)));
                    }
                    else if(fn.Name == "defm")  // defmacro
                    {
                        var argsc = args as CCCons;

                        var symbol = argsc.car as CCIdentifier;
                        var margs = argsc.cadr;
                        var mbody = argsc.caddr;

                        var pos = Index(symbol, env);
                        if (pos == null)
                        {
                            // create new symbol(root environment)
                            CCCons i = mc_symbols;
                            while (i.cdr != null)
                                i = i.cdr as CCCons;

                            if (i.car == null)
                            {
                                i.car = symbol;
                            }
                            else
                            {
                                var cons = new CCCons(symbol, null);
                                i.cdr = cons;
                            }

                            // re-find index
                            pos = Index(symbol, env);
                        }

                        return CompileLambda(mbody, new CCCons(margs, env), new CCCons(new CCIS("ST"), new CCCons(pos, cont)));
                    }
                    else if(fn.Name == "macroexpand-1")
                    {
                        var form = (args as CCCons).car as CCCons;

                        var macfn = form.car;
                        var macarg = form.cdr;

                        if (Index2(macfn as CCIdentifier, mc_symbols, 1) != null)
                        {   // macro expansion compile
                            var expand_code = new CCCons(new CCIS("LDC"), new CCCons(macarg, new CCCons(new CCIS("LD"), new CCCons(Index(macfn as CCIdentifier, env), new CCCons(new CCIS("AP"), new CCCons(new CCIS("HALT"), null))))));
                            vm.Eval(expand_code);
                            return new CCCons(new CCIS("LDC"), new CCCons(vm.GetResult(), cont));
                        }
                        else
                        {
                            return null;
                        }
                    }
                    else // application or macro
                    {
                        // check if it is macro or not
                        if (Index2(fcn as CCIdentifier, mc_symbols, 1) != null)
                        {   // macro expansion compile
                            var expand_code = new CCCons(new CCIS("LDC"), new CCCons(args, new CCCons(new CCIS("LD"), new CCCons(Index(fcn as CCIdentifier, env), new CCCons(new CCIS("AP"), new CCCons(new CCIS("HALT"), null))))));
                            vm.Eval(expand_code);
                            var r = vm.GetResult();
                            return Compile1(r, env, cont);
                        }
                        else // normal application
                        {
                            var func = Index(fcn as CCIdentifier, env);
                            if(func == null)
                            {
                                throw new CCCompileIdentifierNotFoundException(fcn.ToString());
                            }
                            else
                            {
                                return new CCCons(null, CompileApp(args as CCCons, env, new CCCons(new CCIS("LD"), new CCCons(func, new CCCons(new CCIS("AP"), cont)))));
                            }
                        }
                    }
                }
                else // application with nested function
                {
                    return new CCCons(null, CompileApp(args as CCCons, env, Compile1(fcn, env, new CCCons(new CCIS("AP"), cont))));
                }
            }
        }
Exemplo n.º 37
0
 private void SetEnvIndex(int x, int y, CCObject v)
 {
     SetEnvIndex1(x, y, Env.Stack, v);
 }
Exemplo n.º 38
0
 private CCObject CompileIf(CCObject test, CCObject t, CCObject f, CCCons env, CCObject cont)
 {
     return Compile1(test, env, new CCCons(
         new CCIS("SEL"), new CCCons(
             Compile1(t, env, new CCCons(new CCIS("JOIN"), null)), new CCCons(
                 Compile1(f, env, new CCCons(new CCIS("JOIN"), null)), cont))));
 }
Exemplo n.º 39
0
 private void SetEnvIndex1(int x, int y, CCCons env, CCObject v)
 {
     if (x > 1)
     {
         var cdr = env.cdr as CCCons;
         SetEnvIndex1(x - 1, y, cdr, v);
     }
     else
     {
         var car = env.car as CCCons;
         SetEnvIndex2(y, car, v);
     }
 }
Exemplo n.º 40
0
 private void SetEnvIndex2(int y, CCCons env, CCObject v)
 {
     if (y > 1)
     {
         var cdr = env.cdr as CCCons;
         if (cdr == null)
         {
             cdr = new CCCons(null, null);
             env.cdr = cdr;
         }
         SetEnvIndex2(y - 1, cdr, v);
     }
     else
     {
         env.car = v;
     }
 }
Exemplo n.º 41
0
 private CCObject QuoteObject(CCObject obj)
 {
     return new CCCons(new CCIdentifier() { Name = "quote" }, new CCCons(obj, null));
 }
Exemplo n.º 42
0
 public void Push(CCObject val)
 {
     Stack = new CCCons(val, Stack);
 }
Exemplo n.º 43
0
 public void Eval(CCObject obj)
 {
     Stack.Clear();
     Code.Stack = obj as CCCons;
     Dump.Clear();
     while (EvalTop()) ;
 }
Exemplo n.º 44
0
 private CCObject GetEnvIndex1(int x, int y, CCObject env, bool is_rest)
 {
     if (x > 1)
     {
         return GetEnvIndex1(x - 1, y, (env as CCCons).cdr, is_rest);
     }
     else
     {
         return GetEnvIndex2(y, (env as CCCons).car, is_rest);
     }
 }
Exemplo n.º 45
0
 private CCObject GetEnvIndex2(int y, CCObject env, bool is_rest)
 {
     if(y > 1)
     {
         return GetEnvIndex2(y - 1, (env as CCCons).cdr, is_rest);
     }
     else
     {
         if(is_rest)
         {
             return env;
         }
         else
         {
             return (env as CCCons).car;
         }
     }
 }
Exemplo n.º 46
0
 public CCCons(CCObject a, CCObject d)
 {
     car = a;
     cdr = d;
 }
Exemplo n.º 47
0
 private CCObject CompileBuiltin(CCObject args, CCCons env, CCObject cont)
 {
     if (args == null)
     {
         return cont;
     }
     else
     {
         return CompileBuiltin((args as CCCons).cdr, env, Compile1((args as CCCons).car, env, cont));
     }
 }