/// <summary> /// This will bind any ISystem implementations found within Systems, ViewResolvers folders which are located /// in a child namespace of the application. /// </summary> /// <remarks> /// This is a conventional based binding, and if you need other conventions then look at wrapping BindAnySystemsInNamespace /// </remarks> /// <param name="application">The application to act on</param> public static void BindAllSystemsWithinApplicationScope(this EcsRxApplicationBehaviour application) { var applicationNamespace = application.GetType().Namespace; var namespaces = new[] { $"{applicationNamespace}.Systems", $"{applicationNamespace}.ViewResolvers" }; BindSystemsInNamespace.Bind(application.DependencyContainer.NativeContainer as DiContainer, namespaces); }
/// <summary> /// This will bind any ISystem implementations that are found within the namespaces provided /// </summary> /// <remarks> /// This is not recursive, so if you have child namespaces they will need to be provided, /// it is also advised you wrap this method with your own conventions like BindAllSystemsWithinApplicationScope does. /// </remarks> /// <param name="application">The application to act on</param> /// <param name="namespaces">The namespaces to be scanned for implementations</param> public static void BindAnySystemsInNamespace(this EcsRxApplicationBehaviour application, params string[] namespaces) { BindSystemsInNamespace.Bind(application.DependencyContainer.NativeContainer as DiContainer, namespaces); }
public override void InstallBindings() { BindSystemsInNamespace.Bind(Container, SystemNamespaces); }