Пример #1
0
        /// <summary>
        ///     Registers the events this <see cref="GlobalObjectController" /> wants to listen to.
        /// </summary>
        /// <param name="gameMode">The running GameMode.</param>
        public virtual void RegisterEvents(BaseMode gameMode)
        {
            Console.WriteLine("Loaded {0} commands.",
                              RegisterCommands(Assembly.GetAssembly(gameMode.GetType())));

            gameMode.PlayerCommandText += gameMode_PlayerCommandText;
        }
Пример #2
0
        /// <summary>
        ///     Registers the services this controller provides.
        /// </summary>
        /// <param name="gameMode">The game mode.</param>
        /// <param name="serviceContainer">The service container.</param>
        public virtual void RegisterServices(BaseMode gameMode, GameModeServiceContainer serviceContainer)
        {
            CommandsManager = new CommandsManager(gameMode);
            serviceContainer.AddService(CommandsManager);

            // Register commands in game mode.
            CommandsManager.RegisterCommands(gameMode.GetType());
        }
        /// <summary>
        ///     Registers the services this controller provides.
        /// </summary>
        /// <param name="gameMode">The game mode.</param>
        /// <param name="serviceContainer">The service container.</param>
        public virtual void RegisterServices(BaseMode gameMode, GameModeServiceContainer serviceContainer)
        {
            CommandsManager = new CommandsManager(gameMode);
            serviceContainer.AddService(CommandsManager);

            // Register commands in game mode.
            CommandsManager.RegisterCommands(gameMode.GetType());
        }
Пример #4
0
 public override void RegisterServices(BaseMode gameMode, GameModeServiceContainer serviceContainer)
 {
     CommandsManager = new MyCommandsManager(gameMode);
     serviceContainer.AddService(CommandsManager);
     CommandsManager.RegisterCommands(gameMode.GetType());
 }