using _Project.Develop.Runtime.UI; using _Project.Develop.Runtime.UI.Core; using _Project.Develop.Runtime.UI.Screens.MainMenu; using Assets._Project.Develop.Runtime.Infrastructure.DI; using Assets._Project.Develop.Runtime.Utilities.AssetsManagement; using Assets._Project.Develop.Runtime.Utilities.SceneManagement; using Object = UnityEngine.Object; namespace Assets._Project.Develop.Runtime.Meta.Infrastructure { public class MainMenuContextRegistrations { public static void Process(DIContainer container) { container.RegisterAsSingle(CreateMainMenuUIRoot).NonLazy(); container.RegisterAsSingle(CreateMainMenuPresentersFactory); container.RegisterAsSingle(CreateMainMenuScreenPresenter).NonLazy(); container.RegisterAsSingle(CreateMainMenuPopupService); } private static MainMenuPresentersFactory CreateMainMenuPresentersFactory(DIContainer c) => new(c); private static MainMenuPopupService CreateMainMenuPopupService(DIContainer c) { return new MainMenuPopupService( c.Resolve(), c.Resolve(), c.Resolve()); } private static MainMenuUIRoot CreateMainMenuUIRoot(DIContainer c) { ResourcesAssetsLoader loader = c.Resolve(); MainMenuUIRoot uiRootPrefab = loader.Load(PathToResources.UI.Screens.MainMenu); return Object.Instantiate(uiRootPrefab); } private static MainMenuScreenPresenter CreateMainMenuScreenPresenter(DIContainer c) { MainMenuUIRoot uiRoot = c.Resolve(); MainMenuScreenView view = c.Resolve().Create(uiRoot.HUDLayer); MainMenuScreenPresenter presenter = c.Resolve().CreateMainMenuScreen(view); return presenter; } } }