public static void AddHelp(this IServiceCollection services, Action<HelpServiceOptions> options = null) { var helpServiceOptions = new HelpServiceOptions(); options?.Invoke(helpServiceOptions); services.AddSingleton<IHelpService>(svc => new HelpService(svc.GetRequiredService<IGame>(), helpServiceOptions)); }
public HelpService(IGame game, HelpServiceOptions options) { _game = game; _options = options; }