Пример #1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            FrameCounter = new EngineFrameCounter(this);

            KeyboardTestExpression = new FnScriptExpression <bool>(null, null, null);
            KeyboardTestExpression.Compile("if(IsKeyDown(A, Down, Left), false, true) && IsKeyDown(E)");

            base.Initialize();
        }
Пример #2
0
        private void btnCompile_Click(object sender, EventArgs e)
        {
#if COMPILERTESTING
            TimeSpan totalTime = System.DateTime.Now.TimeOfDay;

            for (int i = 0; i < ITERATIONS/100; i++)
            {
#endif
                Expression = ExpressionCompiler.Compile<Double>(txtCompileInput.Text, null, null);
#if COMPILERTESTING
            }

            txtCompileOutput.Text = Expression.RawExpression;

            totalTime = System.DateTime.Now.TimeOfDay - totalTime;

            String ticks = "For fnScript 2.5 Compiler, " + (ITERATIONS/100).ToString() + " compilations timing: " + totalTime.ToString();

            this.Text = ticks;
#else
            this.Text = "Expression \"" + txtCompileInput.Text + "\" Compiled Successfully";
#endif
        }