/// <summary> /// Registers the services this controller provides. /// </summary> /// <param name="gameMode">The game mode.</param> /// <param name="serviceContainer">The service container.</param> public override void RegisterServices(BaseMode gameMode, GameModeServiceContainer serviceContainer) { CommandsManager = new CommandsManager(gameMode); serviceContainer.AddService(CommandsManager); // Register commands in game mode. CommandsManager.RegisterCommands(gameMode.GetType()); }
public MyCommandManager(BaseMode gameMode) : base(gameMode) { }
protected BaseMode(bool redirectConsole) { if (redirectConsole) Console.SetOut(new ServerLogWriter()); if (FrameworkConfiguration.MessageLevel == FrameworkMessageLevel.Debug) { var type = Type.GetType("Mono.Runtime"); var displayName = type?.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static); if (displayName != null) FrameworkLog.WriteLine(FrameworkMessageLevel.Debug, "Detected mono version: {0}", displayName.Invoke(null, null)); } Instance = this; }
public TestServiceB(BaseMode gameMode) : base(gameMode) { }
/// <summary> /// Performs post-load actions. /// </summary> /// <param name="gameMode">The game mode.</param> public virtual void PostLoad(BaseMode gameMode) { }
/// <summary> /// Loads controllers provided by this extensions. /// </summary> /// <param name="gameMode">The game mode.</param> /// <param name="controllerCollection">The controller collection.</param> public virtual void LoadControllers(BaseMode gameMode, ControllerCollection controllerCollection) { gameMode.AutoloadControllersForAssembly(GetType().GetTypeInfo().Assembly); }
/// <summary> /// Loads services provided by this extensions. /// </summary> /// <param name="gameMode">The game mode.</param> public virtual void LoadServices(BaseMode gameMode) { }
public override void PostLoad(BaseMode gameMode) { Console.WriteLine("ExtensionB extension was loaded!"); }
/// <summary> /// Initializes a new instance of the <see cref="BaseMode" /> class. /// </summary> protected BaseMode() { Instance = this; }