Exemplo n.º 1
0
 private bool registerMacro(String macro, String name, IScriptCompiler scriptCompiler, IMacroService macroService, XmlScriptExecutor executor)
 {
     ScriptedMacro scriptedMacro = new ScriptedMacro(executor);
     scriptedMacro.Name = name;
     scriptedMacro.Script = scriptCompiler.Compile(macro, name);
     return macroService.registerMacro(new XnaScrapId(name), scriptedMacro);
 }
Exemplo n.º 2
0
        public TestGame(int processId = 0, string window = "")
        {
            //graphics = new GraphicsDeviceManager(this);
            //graphics.PreferredDepthStencilFormat = DepthFormat.Depth24;
            //graphics.ApplyChanges();
            Content.RootDirectory = "Content";

            // Frame rate is 30 fps by default for Windows Phone.
            TargetElapsedTime = TimeSpan.FromTicks(333333);

            m_core = new Core(this);
            m_scriptExecutor = XmlScriptExecutor.GetInstance(this);
            m_scriptCompiler = new XmlScriptCompilerService(this);
            m_collisionManager = new CollisionManager(this);
            m_sceneManager = new SceneManager(this);
            m_inputManager = new InputManager(this);
            m_animationService = new AnimationService(this);
            // graphics should be inserted last, as they should be updated at the end of a frame
            //RenderManager.TargetWindow target = new RenderManager.TargetWindow();
            //target.ProcessId = processId;
            //target.ChildWndCaption = window;
            //m_renderManager = new RenderManager(this, graphics, target);
            m_renderManager = new RenderManager(this, graphics);
            #if WINDOWS
            m_netCtrl = new NetCtrlService(this);
            #endif
        }
Exemplo n.º 3
0
 public ScriptedMacro(XmlScriptExecutor scriptExecutor)
 {
     m_scriptExecutor = scriptExecutor;
 }
Exemplo n.º 4
0
 public ScriptedMacro(XmlScriptExecutor scriptExecutor, IScript script)
 {
     m_scriptExecutor = scriptExecutor;
     m_script = script;
 }
Exemplo n.º 5
0
        /// <summary>
        /// I know singelton is odd...
        /// </summary>
        /// <returns></returns>
        public static XmlScriptExecutor GetInstance(Game game)
        {
            if (m_instance == null)
            {
                m_instance = new XmlScriptExecutor(game);

            }
            return m_instance;
        }