コード例 #1
0
ファイル: Program.cs プロジェクト: jmonasterio/xgc3
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            try
            {
                string xgcFile;
                if (args.Length < 1)
                {
                    xgcFile = "GameEditor.xgc.dll";
                    //throw new Exception( @"Command line argument should be compiled dll game file like: C:\src\xgc3\xgc3\GameEditor.xgc.dll");
                }
                else
                {
                    xgcFile = args[0];
                }

                GameManager gm = new GameManager();

                using (XnaGame game = new XnaGame(gm))
                {
                    gm.Game = game;

                    // Create the symbol table. IGNORE the cscript generation... because the script was already
                    //  compiled to a DLL by the XGCC compiler.
                    Compiler compiler = new Compiler();
                    compiler.OpenXml(new FileInfo(xgcFile));
                    compiler.BuildSymbolTable(gm);

                    // Read in XML and flatten out any includes.
                    Loader loader = new Loader();
                    loader.OpenXml(new FileInfo(xgcFile));

                    loader.LoadInstances(gm);

                    // This will create first room and all instances it needs.
                    //compiler.Run(compiler);
                    game.GotoRoom(gm.RunningObjectTable.GetInstance("Editor") as Room, gm); // TODO: First room?

                    game.Run();

                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Application failure: " + ex.Message);
            }
        }
コード例 #2
0
ファイル: GameManager.cs プロジェクト: jmonasterio/xgc3
 /// <summary>
 /// Load all classes then construct the first room.
 /// </summary>
 /// <param name="compiler"></param>
 public void Run(Loader ldr)
 {
 }