using StammGenerator.Commands;
using StammGenerator.Interface;
using StammGenerator.ViewModel;
using System.Threading.Tasks;

namespace StammGenerator.Commands
{
    class SchachtEditCommand : AsyncCommandBase
    {

        private IActualState actualState;
        private IRenavigator renavigator;
        private ManholeListViewModel manholeListViewModel;

        public SchachtEditCommand(IActualState actualState, IRenavigator renavigator, ManholeListViewModel manholeListViewModel)
        {
            this.actualState = actualState;
            this.renavigator = renavigator;
            this.manholeListViewModel = manholeListViewModel;
        }

        public override async Task ExecuteAsync(object? parameter)
        {
            actualState.SetSchacht(manholeListViewModel.SelectedSchacht);
            renavigator.Renavigate();
        }
    }
}
