예제 #1
0
        internal PluginManager(PluginInjector pluginInjector)
        {
            this.pluginInjector = pluginInjector;
            log = pluginInjector.Log;

            pluginInjector.OnAgosGuiInitialized += delegate(object arg) { OnAgosGuiInitialized?.Invoke(arg); };

            pluginInjector.OnGameClientActivated   += delegate(object arg) { OnGameClientActivated?.Invoke(arg); };
            pluginInjector.OnGameClientDeactivated += delegate(object arg) { OnGameClientDeactivated?.Invoke(arg); };
            pluginInjector.OnGameClientInitialized += delegate(object arg)
            {
                init();

                unsetGameStates();
                gameClient = (Game.GameStates.GameClient)arg;
                new GameClient(this, gameClient).StartGameMode();

                OnGameClientInitialized?.Invoke(gameClient);
            };
            pluginInjector.OnGameClientUnload += delegate(object arg) { OnGameClientUnload?.Invoke(arg); };
            pluginInjector.OnGameClientUpdate += delegate(object arg) { OnGameClientUpdate?.Invoke(arg); };

            pluginInjector.OnGameEditorInitialized += delegate(object arg)
            {
                init();

                unsetGameStates();
                gameEditor = (Game.GameStates.GameShipEditor)arg;
                new GameEditor(this, gameEditor).StartGameMode();

                OnGameEditorInitialized?.Invoke(arg);
            };
            pluginInjector.OnGameEditorUnload += delegate(object arg) { OnGameEditorUnload?.Invoke(arg); };
            pluginInjector.OnGameEditorUpdate += delegate(object arg) { OnGameEditorUpdate?.Invoke(arg); };

            pluginInjector.OnGameMenuInitialized += delegate(object arg)
            {
                init();

                unsetGameStates();
                gameMenu = (Game.GameStates.GameMainMenu)arg;
                new GameMenu(this, gameMenu).StartGameMode();

                OnGameMenuInitialized?.Invoke(arg);
            };

            pluginInjector.OnGameServerInitialized += delegate(object arg)
            {
                init();

                unsetGameStates();
                gameServer = (Game.GameStates.GameServer)arg;
                new GameServer(this, gameServer).StartGameMode();

                OnGameServerInitialized?.Invoke(arg);
            };
            pluginInjector.OnGameServerUnload += delegate(object arg) { OnGameServerUnload?.Invoke(arg); };
            pluginInjector.OnGameServerUpdate += delegate(object arg) { OnGameServerUpdate?.Invoke(arg); };
        }
예제 #2
0
 public void IRUpdateGameServer(float dT)
 {
     OnGameServerUpdate?.Invoke(dT);
 }