using System.Collections.Generic;
using System.Threading;
using Cysharp.Threading.Tasks;
using QuizPleaseTest.Common.StateMachine;

namespace QuizPleaseTest.Boot.States
{
    public class BootStatesController : IStatesController<BootStateCode>
    {
        private readonly StatesController<BootStateCode> _statesController;

        public BootStatesController(
            SplashState splashState,
            LoadState loadState,
            MenuState menuState)
        {
            _statesController = new StatesController<BootStateCode>(
                new Dictionary<BootStateCode, IState>
                {
                    { BootStateCode.Splash, splashState },
                    { BootStateCode.Load, loadState },
                    { BootStateCode.Menu, menuState }
                });
        }

        public UniTask EnterStateAsync(BootStateCode code, CancellationToken ct)
        {
            return _statesController.EnterStateAsync(code, ct);
        }
    }
}
