Files
SVSimServer/SVSim.BattleEngine/Engine/Wizard.Battle.Mulligan/PlayerMulliganCtrl.cs
gamer147 0d9d8acae0 feat(battle-engine): M1 auto-copy closure (782 battle-logic files)
Compile-driven bulk-copy loop (tools/engine-port/m1_copy_loop.py) pulled the precise reference closure of the battle-core roots, stopping at the classify god-object/View-VFX-UI boundary. 782 files; no re-explosion (M0 had estimated ~order 1000). Residual frontier = 52 shim-classified + 80 external (Unity/BCL) types to author next.
2026-06-05 16:57:20 -04:00

94 lines
2.9 KiB
C#

using System;
using System.Collections.Generic;
using Cute;
using Wizard.Battle.View;
using Wizard.Battle.View.Vfx;
namespace Wizard.Battle.Mulligan;
public class PlayerMulliganCtrl : MulliganCtrl
{
protected PlayerMulliganView _playerMulliganView;
protected IList<BattleCardBase> m_AbandonList;
public Action OnMulliganLaunchComplete;
protected bool _isSetOnCard;
public IList<BattleCardBase> AbandonList => m_AbandonList;
public bool IsSetOnCard => _isSetOnCard;
public PlayerMulliganCtrl(BattlePlayerBase player, MulliganInfoControl mulliganInfo, IPlayerView view)
: base(player)
{
_playerMulliganView = new PlayerMulliganView(mulliganInfo, view);
_mulliganView = _playerMulliganView;
m_AbandonList = new List<BattleCardBase>();
}
public override VfxBase StartMulliganVfx(SkillProcessor skillProcessor)
{
BattlePlayerBase battlePlayer = GetBattlePlayer();
List<int> indexList = _LotMulliganCardIndex(battlePlayer.DeckCardList.Count);
_CreateMulliganCardList(indexList);
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;
OnMulliganLaunchComplete.Call();
}));
return sequentialVfxPlayer;
}
public override VfxBase SubmitMulliganVfx(IList<BattleCardBase> abandonCards)
{
_mulliganChangedNum = abandonCards.Count;
ParallelVfxPlayer parallelVfxPlayer = ParallelVfxPlayer.Create();
if (abandonCards.Count > 0)
{
SequentialVfxPlayer sequentialVfxPlayer = SequentialVfxPlayer.Create();
sequentialVfxPlayer.Register(_MulliganCardChange(abandonCards));
parallelVfxPlayer.Register(sequentialVfxPlayer);
}
parallelVfxPlayer.Register(new DummyDeckRemoveCardVfx(isPlayer: true, 3));
return parallelVfxPlayer;
}
protected override VfxBase _MulliganSwap(IDictionary<int, BattleCardBase> newList, IList<BattleCardBase> oldList)
{
return _CardSwapAndMoveToStaticPositionVfx(newList, oldList, isCardHolderPlayer: true, isHideMulliganTitle: true);
}
public PlayerMulliganView GetPlayerMulliganView()
{
return _playerMulliganView;
}
public void RegisterAbandonCard(BattleCardBase card)
{
if (_firstDrawList.Contains(card) && !m_AbandonList.Contains(card))
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_1);
m_AbandonList.Add(card);
}
}
public void TakeOutAbandonCard(BattleCardBase card)
{
if (m_AbandonList.Contains(card))
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARD_MOVE_SINGLE_1);
m_AbandonList.Remove(card);
}
}
}