using System; namespace Discord.Commands { public interface IDependencyMap { /// /// Add an instance of a service to be injected. /// /// The type of service. /// The instance of a service. void Add(T obj) where T : class; /// /// Add a service that will be injected by a new instance every time. /// /// The type of instance to inject. void AddTransient() where T : class, new(); /// /// Add a service that will be injected by a new instance every time. /// /// The type to look for when injecting. /// The type to inject when injecting. /// /// map.AddTransient<IService, Service> /// void AddTransient() where TKey: class where TImpl : class, TKey, new(); /// /// Add a service that will be injected by a factory. /// /// The type to look for when injecting. /// The factory that returns a type of this service. void AddFactory(Func factory) where T : class; /// /// Pull an object from the map. /// /// The type of service. /// An instance of this service. T Get(); /// /// Try to pull an object from the map. /// /// The type of service. /// The instance of this service. /// Whether or not this object could be found in the map. bool TryGet(out T result); /// /// Pull an object from the map. /// /// The type of service. /// An instance of this service. object Get(Type t); /// /// Try to pull an object from the map. /// /// The type of service. /// An instance of this service. /// Whether or not this object could be found in the map. bool TryGet(Type t, out object result); } }