using JetBrains.Annotations;
using UnityEngine;
using VContainer;
using VContainer.Unity;

public class GameLifeTimeScope : LifetimeScope
{
    [SerializeField] private InputReader _inputReader;
    [SerializeField] private DeathScreenView deathview;
    [SerializeField] private StartScreenView startView;
    [SerializeField] private GameScreenView gameScreenView;
    [SerializeField] private PauseScreenView pauseScreenView;

    private void Start()
    {
        Debug.Log("startView is: " + startView);
    }
    protected override void Configure(IContainerBuilder builder)
    {

        builder.RegisterComponentInHierarchy<PlatformPool>();
        builder.RegisterComponentInHierarchy<Player>();
        builder.RegisterComponentInHierarchy<PlatformManager>();
        builder.RegisterComponentInHierarchy<AudioController>();
        builder.RegisterInstance(_inputReader).As<IInputReader>();

        builder.Register<ScoreService>(Lifetime.Singleton);
        builder.Register<DeathScreenController>(Lifetime.Singleton).WithParameter(deathview);
        builder.Register<StartScreenController>(Lifetime.Singleton).WithParameter(startView);
        builder.Register<GameScreenController>(Lifetime.Singleton).WithParameter(gameScreenView);
        builder.Register<PauseScreenController>(Lifetime.Singleton).WithParameter(pauseScreenView);

    }
}
