Example #1
0
        public static void Run()
        {
            try
            {
                compiler = new DotNetCompiler(LibraryContext.Current, @"game.exe");

                compiler.InitCompiler();

                compiler.CompileScripts();
                compiler.CompileRooms();

                compiler.Save();

                Game.InitRoom += new Action<Room>(Game_InitRoom);

                //Game.Run();
            }
            catch (ProgramError err)
            {
                int line = 0, col = 0;

                string msg = string.Format("ERROR in code at line {0} pos {1}:\n{2}", line, col, err.Message);
                switch (err.Location)
                {
                    case CodeLocation.Script:
                        msg = string.Format("COMPILAION ERROR in Script:\nError in code at line {0}:\n\n\nat position {1}: {2}", line, col, err.Message);
                        break;
                }
                System.Windows.Forms.MessageBox.Show(msg, Game.Name, System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error);
            }
        }
 public NaiveDotNetTraverser(DotNetCompiler compiler, ILGenerator generator)
 {
     Compiler = compiler;
     IL       = generator;
 }
 public NaiveDotNetTraverser(DotNetCompiler compiler, ILGenerator generator)
 {
     Compiler = compiler;
     IL = generator;
 }