files arranged using assembly defn
This commit is contained in:
43
Assets/DarkMatter/Code/App/Installers/GameLifetimeScope.cs
Normal file
43
Assets/DarkMatter/Code/App/Installers/GameLifetimeScope.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using Darkmatter.Core;
|
||||
using Darkmatter.Domain;
|
||||
using Darkmatter.Presentation;
|
||||
using UnityEngine;
|
||||
using VContainer;
|
||||
using VContainer.Unity;
|
||||
|
||||
namespace Darkmatter.App
|
||||
{
|
||||
public class GameLifetimeScope : LifetimeScope
|
||||
{
|
||||
[SerializeField] private PlatformPool pool;
|
||||
[SerializeField] private PlatformManager manager;
|
||||
[SerializeField] private InputReaderSO inputReader;
|
||||
[SerializeField] private GameSessionSO gameSession;
|
||||
[SerializeField] private Player player;
|
||||
[SerializeField] private AudioController audioController;
|
||||
|
||||
//UI References
|
||||
[SerializeField] private GameScreenView gameScreenView;
|
||||
[SerializeField] private StartScreenView startScreenView;
|
||||
[SerializeField] private DeathScreenView deathScreenView;
|
||||
[SerializeField] private PauseScreenView pauseScreenView;
|
||||
protected override void Configure(IContainerBuilder builder)
|
||||
{
|
||||
builder.RegisterComponent(pool).As<IPool<Platform>>();
|
||||
builder.RegisterComponent(manager).As<IPlatformManager>();
|
||||
builder.RegisterInstance(inputReader).As<IInputReader>();
|
||||
builder.Register<ScoreService>(Lifetime.Singleton).As<IScoreService>();
|
||||
builder.RegisterInstance<GameSessionSO>(gameSession).As<IGameSession>();
|
||||
builder.RegisterComponent(player).As<IPlayer>();
|
||||
builder.RegisterComponent(audioController).As<IAudioController>().AsSelf();
|
||||
|
||||
|
||||
builder.RegisterEntryPoint<StartScreenController>(Lifetime.Singleton).WithParameter(startScreenView);
|
||||
builder.Register<GameScreenController>(Lifetime.Singleton).WithParameter(gameScreenView).As<IGameScreenController>();
|
||||
builder.Register<PauseScreenController>(Lifetime.Singleton).WithParameter(pauseScreenView).As<IPauseScreenController>();
|
||||
builder.Register<DeathScreenController>(Lifetime.Singleton).WithParameter(deathScreenView).As<IDeathScreenController>();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user