using System.Collections.Generic;
using Wizard.Battle.View;
using Wizard.Battle.View.Vfx;

namespace Wizard.Battle.Mulligan;

public class NetworkPlayerMulliganCtrl : PlayerMulliganCtrl
{
	public NetworkPlayerMulliganCtrl(BattlePlayerBase player, MulliganInfoControl mulliganInfo, IPlayerView view)
		: base(player, mulliganInfo, view)
	{
		_playerMulliganView = new PlayerMulliganView(mulliganInfo, view);
		_mulliganView = _playerMulliganView;
		m_AbandonList = new List<BattleCardBase>();
	}

	public override VfxBase StartMulliganVfx(SkillProcessor skillProcessor)
	{
		DrawFirstMulliganCard();
		SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
		sequentialVfxPlayer.Register(new PlayerMulliganDrawVfx(_firstDrawList, GetMulliganInfo()));
		sequentialVfxPlayer.Register(_playerMulliganView.SortFirstDrawsToKeepZone(_firstDrawList));
		sequentialVfxPlayer.Register(InstantVfx.Create(delegate
		{
			for (int i = 0; i < _firstDrawList.Count; i++)
			{
				_firstDrawList[i].SetOnDraw(draw: false);
			}
			_isSetOnCard = true;
		}));
		_battlePlayer.CallRecordingMulliganStart(_firstDrawList);
		return sequentialVfxPlayer;
	}

	protected override IDictionary<int, BattleCardBase> _MoveNewCardToHand(IList<BattleCardBase> AbandonCards)
	{
		return NetworkMoveNewCardToHand(AbandonCards);
	}
}
