public static MapHandler DependencyInjection() { return(ReflectionUtility.DependencyInjection() .Use <IPacketTemplate, PacketTemplate>() .Use <ICacheUtility, CacheUtility>() .Use <IBot, PalBot>()); }
public virtual IBot GenerateBot() { var dih = ReflectionUtility.DependencyInjection() .Use <IBot, BotStub>(); var bot = (BotStub)dih.Build <IBot>(); bot.PluginSets = PluginSet; bot.Prefix = Prefix; return(bot); }
public static MapHandler DependencyResolution() { var bc = new BroadcastUtility(); return(ReflectionUtility.DependencyInjection() .AllOf <IPacketHandler>() .AllOf <IWatch>() .Use <IReflectionUtility, PalReflectionUtility>((c, i) => new PalReflectionUtility(c)) .Use <IBot, PalBot>() .Use <IPacketSerializer, PacketSerializer>() .Use <IPacketDeserializer, PacketDeserializer>() .Use <IPacketMapper, PacketMapper>() .Use <IPacketWatcher, PacketWatcher>() .Use <IPacketTemplates, PacketTemplates>() .Use <IZLibCompression, ZLibCompression>() .Use <IAuthenticationUtility, AuthenticationUtility>() .Use <IPacketHandlerHub, PacketHandlerHub>() .Use <ISubProfiling, SubProfiling>(new SubProfiling(bc)) .Use <IBroadcastUtility, BroadcastUtility>(bc)); }
public static IServiceProvider ConfigureSparkBot(this IServiceCollection services, Config config, Action <MapHandler> handler = null) { try { var map = ReflectionUtility.DependencyInjection() .Use <IBot, SparkBot>() .Config(c => { c.ForSingletonOf <IBot>(); }) .Use <IPluginManager, PluginManager>() .Use <IConfig, Config>(config); handler?.Invoke(map); var container = map.Create(); return(ConfigureSparkBot(services, container)); } catch (Exception ex) { Log(ex); throw; } }
public static MapHandler DependencyResolution() { return(ReflectionUtility.DependencyInjection() .Use <IBot, RedditBot>()); }