示例#1
0
 public GameEngine(IEditor editor    = null, bool _enableUDPConsole = true,
                   bool _passiveMode = false)
 {
     // Only create essential variables here
     // debug and console
     m_passiveMode = _passiveMode;
     m_console     = new CatConsole();
     if (_enableUDPConsole)
     {
         m_updConsolePanel = new UDPConsolePanel(m_console);
         m_updConsolePanel.Start();
     }
     // set game mode
     _editor = editor;
     if (editor != null)
     {
         _gameEngineMode   = GameEngineMode.MapEditor;
         _gameInEditorMode = InEditorMode.Editing;
     }
     else
     {
         _gameEngineMode = GameEngineMode.InGame;
     }
     // graphics device
     InitGraphicsDevice();
 }
示例#2
0
 public void LoadConsoleCommands(string libPath)
 {
     string[] files = Directory.GetFiles(libPath, "*.dll");
     foreach (string file in files)
     {
         Assembly assembly = Assembly.LoadFrom(file);
         CatConsole.SearchInAssembly(assembly, consoleCommands);
     }
 }
示例#3
0
 public void Update()
 {
     while (m_inputMsg.Count > 0)
     {
         String          str     = m_inputMsg.Dequeue() as String;
         IConsoleCommand commend = CatConsole.IntepreteCommendString(str);
         if (commend != null)
         {
             m_console.PushCommend(commend, this);
         }
     }
 }
示例#4
0
 public UDPConsolePanel(CatConsole _console)
 {
     m_console = _console;
 }