using System;
using Minesweeper.Presentation.Presenters;
using VContainer.Unity;

namespace Minesweeper.Infrastructure
{
    public sealed class MinesweeperEntryPoint : IStartable, IDisposable
    {
        private readonly MainMenuPresenter mainMenuPresenter;
        private readonly TopPanelPresenter topPanelPresenter;
        private readonly GamePresenter gamePresenter;

        public MinesweeperEntryPoint(MainMenuPresenter mainMenuPresenter, TopPanelPresenter topPanelPresenter, GamePresenter gamePresenter)
        {
            this.mainMenuPresenter = mainMenuPresenter;
            this.topPanelPresenter = topPanelPresenter;
            this.gamePresenter = gamePresenter;
        }

        public void Start()
        {
            topPanelPresenter.Initialize();
            mainMenuPresenter.Initialize();
            gamePresenter.Initialize();
        }

        public void Dispose()
        {
            gamePresenter.Dispose();
            mainMenuPresenter.Dispose();
            topPanelPresenter.Dispose();
        }
    }
}
