Пример #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;
 }