Пример #1
0
        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));
        }
Пример #2
0
 public HelpService(IGame game, HelpServiceOptions options)
 {
     _game = game;
     _options = options;
 }