engine cleanup passes 4-7 + multi-instancing ambient rip

Squashes 146 commits from battle-engine-extraction. Net: 2,045 files changed,
+11,896 / -158,687 lines. Ships engine passes 4-7 (dead-code cull, view-layer
stub, receive-path shrink) plus the Phase-5 AsyncLocal ambient deletion that
turns concurrent battles into a type-system property rather than a scope
contract.

## What landed

**Passes 4-7 (chunks 1-34):** Extended the Phase-4 const-false collapse into a
cascading cull across the skill graph, view layer, and receive-path periphery.
Six mode flags (IsWatchBattle/IsReplayBattle/IsAdmin/IsAdminWatch/IsPuzzleQuest/
IsAINetwork) became `const false`, every guarded block deleted. Field*.cs
subclass ctors + BackGroundBase + ObjectChecker culled to no-ops. Mulligan
family reworked to take a mgr param through IMulliganMgr.InitMulligan.
Emotion/Recovery/Resource clusters null-stubbed. Prediction/OperationSimulator/
skill filters converted from static ambient reads to per-mgr reads via
SkillPrm.ownerCard.SelfBattlePlayer.BattleMgr / ins.BattleMgr / this.BattleMgr.

**Phase-5 ambient rip (chunks 35-47):** Deleted BattleAmbient / BattleAmbient-
Context / TestBattleScope in full. Every per-battle mutable slot now lives on
the mgr instance itself:
  mgr.InstanceIsForecast / InstanceIsRandomDraw / InstanceRecoveryInfo /
  InstanceViewerId / InstanceNetworkAgent / GameMgr
BattleManagerBase.GetIns() returns null unconditionally; the residual static
flags + 3 façades (Certification.ViewerId, Data.BattleRecoveryInfo,
ToolboxGame.RealTimeNetworkAgent) are null-tolerant defaults kept for the
handful of engine-internal readers that still reference their types. Zero
BattleAmbient references anywhere in engine + node + tests.

Added pre-seeded GameMgr ctor overload threaded through the mgr chain
(BattleManagerBase → SingleBattleMgr / NetworkBattleManagerBase → NetworkStandard-
BattleMgr → HeadlessBattleMgr / HeadlessNetworkBattleMgr). Fixtures build a
GameMgr, seed it via HeadlessEngineEnv.SeedCharaIds/SeedNetUser, and pass it
to the mgr's ctor — no ambient reach.

Node side (SVSim.BattleNode/SessionBattleEngine): _ctx replaced with a plain
GameMgr field; 34 `using var _ambient = BattleAmbient.Enter(_ctx)` scope wraps
ripped from every accessor and mutator; EngineGlobalInit.WirePerSessionGameMgr
takes GameMgr as a param and runs from SessionBattleEngine.SetupInternal
BEFORE mgr construction.

Test side: TestBattleScope deleted; 18 fixture [SetUp]s migrated to
`HeadlessEngineEnv.EnsureProcessGlobals()`; MultiInstanceEngineTests rewritten
around per-mgr construction (GetIns() → null is the pinned invariant).

## Regression fixes

- **chunk-48** (MulliganCtrl): chunk-35's `= null` stubs on card lookups broke
  the live receive-driven Deal path (BattlePlayerBase.DrawCard NRE'd downstream
  of NetworkPlayerMulliganCtrl.StartMulliganVfx). Restored the three lookups
  via `_battlePlayer.BattleMgr.GetBattleCardIdx`. Engine tests were satisfied
  by the WireMulliganPhase seam; unit tests exposed the live-path gap.

## Ship state

- SVSim.BattleEngine.Tests: 56/56 pass, 2 skip
- SVSim.UnitTests: 1554/1554 pass (was 1523/31-fail before chunk 48)
- Solution build: 0 source warnings (40 pre-existing NU1902 MessagePack CVEs
  in SVSim.EmulatedEntrypoint, unrelated)
- Sequential PVP smoke: verified live (two back-to-back battles, no regression
  on cleanup/spinup)
- Concurrent PVP smoke: verified live

Adds tools/engine-port/ClosureAnalyzer/ — the Roslyn transitive-type-closure
analyzer needed to make future cascade cleanup safe (per feedback memory
"Engine cleanup needs closure tool" from the 2026-06-28 pass-3 failure).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
gamer147
2026-07-03 19:18:54 -04:00
parent 5c1db83967
commit 2d9a6eea4b
2045 changed files with 11704 additions and 158495 deletions

View File

@@ -8,7 +8,6 @@ namespace Wizard.DeckCardEdit;
public class CachingCardBundle : CardBundle
{
public const int CACHE_NUM_MAX = 32;
private List<UIBase_CardManager.CardObjData> _cachedList;

View File

@@ -9,9 +9,6 @@ namespace Wizard.DeckCardEdit;
public class CardBundle
{
private const float ROTATE_INTERVAL = 0.05f;
protected const float ALPHA_DURATION = 0.3f;
protected CardCreator _cardCreator;
@@ -49,21 +46,6 @@ public class CardBundle
}
}
public Dictionary<int, int> DictCardIdNum
{
get
{
Dictionary<int, int> dictionary = new Dictionary<int, int>(_cardList.Count);
foreach (CardObject card in _cardList)
{
dictionary.Add(card.CardId, card.TotalCardNum);
}
return dictionary;
}
}
public List<GameObject> ObjectList => _cardList.ConvertAll((CardObject card) => card.CardObj);
public int CountSum => _cardList.Sum((CardObject card) => card.TotalCardNum);
public virtual int CountKind => _cardList.Count;
@@ -111,14 +93,6 @@ public class CardBundle
fieldNum = tempFieldNum;
}
public void UpdateCardCreator()
{
if (_cardCreator != null)
{
_cardCreator.Tick();
}
}
public CardBundle(CardCreator cardCreator, Transform parent, UITexture sleeveOriginal, float scale, IFormatBehavior formatBehavior, bool isDisplaySpotCardNum = false, bool isHideZeroSpotCardNum = false, bool canUseNonPossessionCard = false)
{
FormatBehavior = formatBehavior;
@@ -305,7 +279,7 @@ public class CardBundle
}
if (num4 > 0f)
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_CARDLIST_REVERSE);
}
if (isRotate)
{
@@ -526,14 +500,6 @@ public class CardBundle
return cardObject;
}
public void EnableAlpha(bool isEnable)
{
_cardList.ForEach(delegate(CardObject card)
{
card.EnableAlpha(isEnable);
});
}
public virtual void DestroyAll()
{
_cardList.ForEach(delegate(CardObject card)
@@ -577,11 +543,6 @@ public class CardBundle
});
}
public bool IsEndRotateAnimation()
{
return _cardList.All((CardObject cardObj) => !cardObj.IsWaitingRotateAnimation);
}
public void CountUseCardNum(List<int> cardIdList, int cardId, out int usePossessionCardNum, out int useSpotCardNum, out int useNonPossessionCardNum)
{
int possessionCardNum = FormatBehavior.GetPossessionCardNum(cardId, isIncludingSpotCard: false);

View File

@@ -172,28 +172,6 @@ public class CardBundleController : CardBundleControllerBase
return result;
}
public void SetSelectionArea(List<int> cardIdList, Action onFirstAnimationFinish = null, float cardRotateDelayTimeMax = float.MaxValue)
{
LoadDeckCard(cardIdList, onFirstAnimationFinish, cardRotateDelayTimeMax);
}
public void ClearSelectionArea()
{
if (base.SelectionAreaList.CountSum == 0)
{
return;
}
foreach (CardObject card in base.SelectionAreaList.CardList)
{
for (int i = 0; i < card.TotalCardNum; i++)
{
base.PagingList.Insert(card, dontCreate: true);
}
}
base.SelectionAreaList.DestroyAll();
UpdatePagingCardInfoAll();
}
public void ChangeCraftMode(bool isCraft)
{
base.IsCraftMode = isCraft;
@@ -332,7 +310,7 @@ public class CardBundleController : CardBundleControllerBase
int usedNum = CountCardNumInSelectionArea(card.CardId, isStrictSameCard: true);
int usedNumWithFoil = CountCardNumInSelectionArea(card.CardId, isStrictSameCard: false);
int haveNumWithFoil = GetHaveNumTotalSameKindWithLimit(card.CardId);
bool isMaintenance = GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(card.CardId);
bool isMaintenance = false; // Pre-Phase-5b: no maintenance list headless
if (base.FormatBehavior.IsConventionMode)
{
haveNum = 3;
@@ -383,7 +361,7 @@ public class CardBundleController : CardBundleControllerBase
{
cardObject.SetCardToBanCard(_cardInfoOriginal);
}
else if (GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(cardObject.CardId))
else if (false /* Pre-Phase-5b: no maintenance list headless */)
{
cardObject.SetCardToMaintenance(_cardInfoOriginal);
cardObject.AttachColorShader();

View File

@@ -129,7 +129,7 @@ public class CardBundleControllerBase
{
for (int i = 0; i < _listNewCardDisplayedIds.Count(); i++)
{
GameMgr.GetIns().GetDataMgr().SetIsNewCard(_listNewCardDisplayedIds[i], isNew: false);
/* Pre-Phase-5b: SetIsNewCard write dropped */
}
}
@@ -205,7 +205,7 @@ public class CardBundleControllerBase
UIEventListener.Get(card.CardObj).onClick = this.OnClickSelectionAreaCard.Invoke;
card.CardObj.AddComponent<UIDragScrollView>();
card.ResetMaterial();
if (GameMgr.GetIns().GetDataMgr().IsNewCard(card.CardId) && !_listNewCardDisplayedIds.Contains(card.CardId))
if (false /* Pre-Phase-5b: no user card state headless */)
{
_listNewCardDisplayedIds.Add(card.CardId);
}
@@ -223,7 +223,7 @@ public class CardBundleControllerBase
UIEventListener.Get(card.CardObj).onScroll = this.OnScrollPagingCard.Invoke;
card.ResetMaterial();
UpdateCardInfo(card);
if (GameMgr.GetIns().GetDataMgr().IsNewCard(card.CardId) && !_listNewCardDisplayedIds.Contains(card.CardId))
if (false /* Pre-Phase-5b: no user card state headless */)
{
_listNewCardDisplayedIds.Add(card.CardId);
}
@@ -282,12 +282,6 @@ public class CardBundleControllerBase
return _filteredAllCardIdListCache;
}
public void EnableAlpha(bool isEnable)
{
SelectionAreaList.EnableAlpha(isEnable);
PagingList.EnableAlpha(isEnable);
}
public int GetHaveNum(int cardId)
{
return FormatBehavior.GetPossessionCardNum(cardId, isIncludingSpotCard: true);

View File

@@ -19,8 +19,6 @@ public class CardCreator
}
}
private const int QUEUE_CAPACITY = 8;
private bool _isBusy;
private List<Task> _taskQueue;

View File

@@ -18,8 +18,6 @@ public class CardObject
public GameObject BlackOut;
private const float ALPHA_TIME = 0.3f;
public UseInfo(GameObject parent, CardMaster.CardMasterId cardMasterId)
{
Parent = parent;
@@ -67,41 +65,6 @@ public class CardObject
}
}
public void SetInfoDestruct(int haveNum, int destructNum, bool isMaintenance, bool isOnlySpotCard, CardMaster.CardMasterId cardMasterId)
{
if ((bool)CardInfoObj)
{
SystemText systemText = Data.SystemText;
if (isMaintenance)
{
SetMaintenance();
}
else if (destructNum <= 0)
{
TweenAlpha.Begin(CardInfoObj.gameObject, 0.3f, 0f);
}
else if (destructNum < haveNum)
{
TweenAlpha.Begin(CardInfoObj.gameObject, 0.3f, 1f);
CardInfoText.text = systemText.Get("Card_0169", destructNum.ToString());
}
else if (!isOnlySpotCard)
{
TweenAlpha.Begin(CardInfoObj.gameObject, 0.3f, 1f);
CardInfoText.text = systemText.Get("Card_0170", destructNum.ToString());
}
if (haveNum <= 0 && !isOnlySpotCard)
{
CardTemplateObj.AttachGrayShader();
}
else
{
CardTemplateObj.AttachShaders(cardMasterId);
}
BlackOut.gameObject.SetActive((haveNum > 0 && (destructNum >= haveNum || isMaintenance)) || isOnlySpotCard);
}
}
public void SetMaintenance()
{
TweenAlpha.Begin(CardInfoObj.gameObject, 0.3f, 1f);
@@ -136,24 +99,6 @@ public class CardObject
}
}
private const float FADE_DURATION = 0.18f;
private const float ROTATE_DURATION = 0.125f;
private const float SCALE_DURATION = 0.1f;
private const float SELECT_SCALE = 1.2f;
private const float EFFECT_SCALE = 500f;
private const float EFFECT_Z = -1f;
public const string EFFECT_CHAR_PATH = "cmn_frame_card_1";
public const string EFFECT_SPELL_PATH = "cmn_frame_card_3";
public const string EFFECT_FIELD_PATH = "cmn_frame_card_2";
private static readonly Vector3 SLEEVE_POSITION = new Vector3(0f, -0.5f, 0f);
private static readonly Vector3 SLEEVE_SCALE = new Vector3(1.025f, 1.025f, 1f);
@@ -288,7 +233,7 @@ public class CardObject
private bool IsIncludingSpotCard()
{
if (IsDisplaySpotCardNum && GameMgr.GetIns().GetDataMgr().SpotCardData.ExistsSpotCard(BaseCard.ids))
if (false /* Pre-Phase-5b: no spot card headless */)
{
if (IsHideZeroSpotCardNum)
{
@@ -463,7 +408,7 @@ public class CardObject
public void UpdateCardInfo(GameObject original, int haveNum, int haveNumWithFoil, int usedNum, int usedNumWithFoil, int sameKindNumMax, bool isMaintenance)
{
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr
MainCardNum = Mathf.Max(_formatBehavior.GetPossessionCardNum(BaseCard.ids, isIncludingSpotCard: false) - usedNum, 0);
SubCardNum = Mathf.Max(Mathf.Min(haveNum - usedNum, dataMgr.SpotCardData.GetSpotCardNum(BaseCard.ids)), 0);
PrepareCardInfo(original);
@@ -471,15 +416,6 @@ public class CardObject
VisibleCardNumLabel(haveNum > 0);
}
public void UpdateCardInfoDestruct(GameObject original, int haveNum, int destructNum, bool isMaintenance, bool isOnlySpotCard)
{
MainCardNum = haveNum - destructNum;
SubCardNum = GameMgr.GetIns().GetDataMgr().SpotCardData.GetSpotCardNum(BaseCard.ids);
PrepareCardInfo(original);
_info.SetInfoDestruct(haveNum, destructNum, isMaintenance, isOnlySpotCard, _formatBehavior.CardMasterId);
VisibleCardNumLabel(haveNum > 0 || isOnlySpotCard);
}
public void SetCardToMaintenance(GameObject original)
{
PrepareCardInfo(original);
@@ -506,26 +442,6 @@ public class CardObject
}
}
public void EnableAlpha(bool isEnable)
{
if (BaseCard != null && !(BaseCard.CardObj == null))
{
if (isEnable)
{
UITexture cardTexture = BaseCard.CardObj.GetComponent<CardListTemplate>()._cardTexture;
Texture mainTexture = cardTexture.material.mainTexture;
cardTexture.mainTexture = mainTexture;
cardTexture.material = null;
cardTexture.depth = -1;
cardTexture.Invalidate(includeChildren: false);
}
else
{
ResetMaterial();
}
}
}
public void ResetMaterial()
{
if (BaseCard != null && !(BaseCard.CardObj == null))
@@ -716,15 +632,6 @@ public class CardObject
}
}
public void AttachNormalShaderRotationOnlyIcon()
{
CardListTemplate component = CardObj.GetComponent<CardListTemplate>();
if (!(component == null))
{
component.AttachNormalShaderRotationOnlyIcon();
}
}
public void AttachRedShader()
{
CardListTemplate component = CardObj.GetComponent<CardListTemplate>();

View File

@@ -15,18 +15,6 @@ public abstract class CardSelectListUIBase : MecanimSceneBase
Prev
}
public const int CARD_PER_PAGE_IN_SELECTION_AREA = 10;
public const int CARD_PER_PAGE = 8;
public const float CARD_WIDTH = 120f;
private const float DRAG_DEGREE = 70f;
public const float SELECTION_AREA_CARD_SCALE = 0.5f;
public const float PAGE_CARD_SCALE = 0.6f;
[SerializeField]
protected MecanimStateBase _stateDefaultView;
@@ -76,9 +64,6 @@ public abstract class CardSelectListUIBase : MecanimSceneBase
[SerializeField]
protected GameObject m_cardInfoOriginal;
[SerializeField]
private GameObject _hideFilter;
[SerializeField]
private FilterController _prefabFilter;
@@ -165,8 +150,6 @@ public abstract class CardSelectListUIBase : MecanimSceneBase
}
}
public bool IsSliding => _slideType != SlideType.None;
protected bool IsShowCardDetailCraftPanel { get; set; } = true;
public IFormatBehavior FormatBehavior { get; private set; }
@@ -265,7 +248,7 @@ public abstract class CardSelectListUIBase : MecanimSceneBase
if (!_isDisableTouchWhileLoading)
{
SearchApplyOwn(m_searchInput.value);
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
}
};
m_searchInput.onSubmit.Add(new EventDelegate(delegate
@@ -299,8 +282,7 @@ public abstract class CardSelectListUIBase : MecanimSceneBase
_selectCardFilter.Hide();
_pagingFilter.Hide();
RegistFilterEvent();
GameMgr.GetIns().GetGameObjMgr().GetUIContainer()
.SetActive(value: false);
/* Pre-Phase-5b: GameObjMgr.GetUIContainer().SetActive(false) dropped; headless has no UIContainer. */
_stateEdit.ResetScroll();
m_searchInput.value = "";
m_searchCancelButton.gameObject.SetActive(value: false);
@@ -336,7 +318,7 @@ public abstract class CardSelectListUIBase : MecanimSceneBase
Toolbox.ResourcesManager.LoadObject<GameObject>(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_card_2", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true)),
Toolbox.ResourcesManager.LoadObject<GameObject>(Toolbox.ResourcesManager.GetAssetTypePath("cmn_frame_card_1", ResourcesManager.AssetLoadPathType.Effect2D, isfetch: true))
};
GameMgr.GetIns().GetEffectMgr().SetUIParticleShader(effectObjList, callback);
/* Pre-Phase-5b: SetUIParticleShader dropped */ if (callback != null) callback();
}
protected void SetupState()
@@ -467,20 +449,9 @@ public abstract class CardSelectListUIBase : MecanimSceneBase
}
}
public void OnBtnPushSeachCancelOwn()
{
if (!IsLoading)
{
SearchApplyOwn("");
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL);
}
}
private void PagingBase(Action<Action> anim, int page, Action next)
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_SLIDE_BTN);
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_CARD_MOVE_OUT);
GameMgr.GetIns().GetSoundMgr().StopSe(Se.TYPE.SYS_CARDLIST_REVERSE);
anim.Call(delegate
{
if (LoadPagingCard(page))
@@ -663,7 +634,7 @@ public abstract class CardSelectListUIBase : MecanimSceneBase
private void SelectCard(GameObject obj, bool isSelectionArea)
{
Se.TYPE setype = Se.TYPE.NONE;
int setype = 0;
CardObject cardObject = SelectionAreaList.FindWithObject(_detailTargetObj);
if (cardObject == null)
{
@@ -672,16 +643,16 @@ public abstract class CardSelectListUIBase : MecanimSceneBase
if (cardObject != null && cardObject.IsVisibleCursorEffect)
{
cardObject.ChangeSelectingState(isSelect: false);
setype = Se.TYPE.SYS_CARD_INFO_CANCEL;
setype = 0;
}
CardObject cardObject2 = (isSelectionArea ? SelectionAreaList.FindWithObject(obj) : PagingList.FindWithObject(obj));
if (cardObject2 != null)
{
cardObject2.ChangeSelectingState(isSelect: true);
setype = Se.TYPE.SYS_CARD_INFO_SMALL;
setype = 0;
}
_detailTargetObj = obj;
GameMgr.GetIns().GetSoundMgr().PlaySe(setype);
}
protected virtual void AccordCardInfo()
@@ -710,23 +681,6 @@ public abstract class CardSelectListUIBase : MecanimSceneBase
}
}
protected void ShowFilterMenu(FilterController filter, string title)
{
HideDetail();
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
dialogBase.SetSize(DialogBase.Size.XL);
dialogBase.SetTitleLabel(title);
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
dialogBase.SetObj(filter.gameObject);
dialogBase.CloseOnOff(flag: false);
filter.Show();
dialogBase.OnClose = delegate
{
filter.Hide();
filter.transform.parent = _hideFilter.transform;
};
}
protected virtual void OnValidateSelectionAreaFilter()
{
_stateCardDrag.OnChangeSelectionAreaFilter();
@@ -772,7 +726,7 @@ public abstract class CardSelectListUIBase : MecanimSceneBase
{
_cardBundle.OnCreateCard(_simpleDetail.CardID);
AccordCardInfo();
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
DataMgr dataMgr = null; // Pre-Phase-5b: headless has no DataMgr
if (dataMgr.GetPossessionCardNum(_simpleDetail.CardID, _isSelectableSpotCard) == 1)
{
if (!_cardBundle.IsCraftMode)

View File

@@ -95,19 +95,6 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase
m_parentCloneCard.gameObject.layer = LayerMask.NameToLayer("Detail");
}
private void Start()
{
if (m_scene == null)
{
MonoBehaviour.print("シーンがセットされていません");
}
_colliderSelectionArea.gameObject.SetActive(value: false);
_colliderPagingArea.gameObject.SetActive(value: false);
m_darkMask_Insert.gameObject.SetActive(value: false);
m_darkMask_Grab.gameObject.SetActive(value: false);
_sameCardAddCollider.gameObject.SetActive(value: false);
}
public override bool onCloseRequest(MecanimStateBase next, bool isSkip)
{
if (!(next == _stateEdit))
@@ -134,7 +121,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase
m_removeInfo.SetActive(value: true);
break;
}
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DRAG_CARD);
}
public override void onFinishCloseAnim()
@@ -276,14 +263,14 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase
}
base.CloseStateName = m_closeStateName_Insert;
_isFlashWhenInsert = true;
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_CARD_MOVE_IN);
}
else
{
m_parentClone_Insert.gameObject.SetActive(value: false);
base.CloseStateName = m_closeStateName_Insert;
_isFlashWhenInsert = false;
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_CARD_MOVE_IN);
}
}
@@ -305,7 +292,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase
m_parentClone_Grab.alpha = 0f;
base.CloseStateName = "";
m_darkMask_Grab.gameObject.SetActive(value: false);
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_CARD_MOVE_OUT);
break;
}
break;
@@ -322,7 +309,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase
m_parentClone_Grab.alpha = 0f;
base.CloseStateName = "";
m_darkMask_Grab.gameObject.SetActive(value: false);
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_CARD_MOVE_OUT);
break;
case Area.OutSelectionArea:
{
@@ -343,7 +330,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase
_stateEdit.RefreshSelectionArea(isImmediate: false);
_stateEdit.RefreshPage(isImmediate: true);
base.CloseStateName = m_closeStateName_Remove;
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_OUT);
break;
}
}
@@ -375,7 +362,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase
}
if (_lastDragArea != Area.NoSelectionArea)
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_DECK_IN);
}
}
}
@@ -407,7 +394,7 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase
{
return null;
}
bool flag = !IsDraggableMaintenance && GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(grabCard.CardId);
bool flag = false; // Pre-Phase-5b: no maintenance list headless
if (grabCard.IsVisibleSleeve || flag)
{
return null;
@@ -579,51 +566,4 @@ public class CardSelectListUI_State_CardDrag : MecanimStateBase
{
DestroyDragCard();
}
public void DragEmulate(CardObject original, CardObject target)
{
CloneToGrab(original);
StartCoroutine(MoveToTarget(m_parentClone_Grab.transform, target.CardObj.transform));
}
public void DropDown(CardObject original)
{
CloneToGrab(original);
Vector3 point = m_parentClone_Grab.transform.position + Vector3.down * 0.5f;
StartCoroutine(MoveToPoint(m_parentClone_Grab.transform, point));
TweenAlpha.Begin(m_parentClone_Grab.gameObject, 0.15f, 0f);
}
private void CloneToGrab(CardObject original)
{
Vector3 position = original.CardObj.transform.position;
DestroyDragCard();
CreateDragCard(original);
m_parentClone_Grab.transform.position = position;
m_parentClone_Grab.transform.localScale = Vector3.one;
m_parentClone_Grab.alpha = 1f;
m_darkMask_Grab.gameObject.SetActive(value: false);
m_darkMask_Insert.gameObject.SetActive(value: false);
m_parentClone_Insert.gameObject.SetActive(value: false);
}
private IEnumerator MoveToTarget(Transform obj, Transform target)
{
for (float num = Vector3.Distance(target.position, obj.position); num >= 0.05f; num = Vector3.Distance(target.position, obj.position))
{
obj.position += (target.position - obj.position) * 0.4f;
yield return null;
}
DestroyDragCard();
}
private IEnumerator MoveToPoint(Transform obj, Vector3 point)
{
for (float num = Vector3.Distance(point, obj.position); num >= 0.05f; num = Vector3.Distance(point, obj.position))
{
obj.position += (point - obj.position) * 0.4f;
yield return null;
}
DestroyDragCard();
}
}

View File

@@ -8,13 +8,6 @@ namespace Wizard.DeckCardEdit;
[RequireComponent(typeof(CardSelectListUI_Positioning))]
public class CardSelectListUI_State_Edit : MecanimStateBase
{
private const float PRESS_TIME_TO_DRAGMODE = 0.5f;
private const float PRESS_POINT_DIST_TO_DRAGMODE = 35f;
private const float PAGING_OFFSET = 1400f;
private const float PAGING_SPEED = 0.4f;
[SerializeField]
private CardSelectListUIBase m_scene;
@@ -53,23 +46,6 @@ public class CardSelectListUI_State_Edit : MecanimStateBase
public bool IsClick { get; private set; }
private void Start()
{
if (m_scene == null)
{
MonoBehaviour.print("シーンがセットされていません");
}
UIScrollView scrollView = m_scrollView;
scrollView.onDragStarted = (UIScrollView.OnDragNotification)Delegate.Combine(scrollView.onDragStarted, (UIScrollView.OnDragNotification)delegate
{
m_scrollViewCenterOnChild.gameObject.SetActive(value: false);
});
UIScrollView scrollView2 = m_scrollView;
scrollView2.onMomentumMove = (UIScrollView.OnDragNotification)Delegate.Combine(scrollView2.onMomentumMove, new UIScrollView.OnDragNotification(Fit));
UIScrollView scrollView3 = m_scrollView;
scrollView3.onStoppedMoving = (UIScrollView.OnDragNotification)Delegate.Combine(scrollView3.onStoppedMoving, new UIScrollView.OnDragNotification(Fit));
}
public override void onOpen()
{
base.onOpen();
@@ -235,11 +211,6 @@ public class CardSelectListUI_State_Edit : MecanimStateBase
_selectionAreaCardPositioning.Clear();
}
public void RemovePaging()
{
_pagingAreaCardPositioning.Clear();
}
private void StartDragState(bool immediate)
{
CardObject cardObject = m_stateDragMode.TryGetCard(_pressObj);
@@ -337,14 +308,4 @@ public class CardSelectListUI_State_Edit : MecanimStateBase
initPress(obj, mode);
}
}
public void DragEmulate(CardObject original, CardObject target)
{
m_stateDragMode.DragEmulate(original, target);
}
public void DropDown(CardObject original)
{
m_stateDragMode.DropDown(original);
}
}

View File

@@ -174,8 +174,6 @@ public class DeckCardEditUI : CardSelectListUIBase
}
}
private const int DEPTH_RESULT_DIALOG = 100;
public static string CurrentDeckName = null;
private static Format EditDeckFormat = Format.Max;
@@ -204,20 +202,6 @@ public class DeckCardEditUI : CardSelectListUIBase
private DeckGroupListData _deckGroupListData;
private const string CRAFT_BTN_LEFT_ON = "pilltab_02_left_on";
private const string CRAFT_BTN_LEFT_OFF = "pilltab_02_left_off";
private const string CRAFT_BTN_RIGHT_ON = "pilltab_02_right_on";
private const string CRAFT_BTN_RIGHT_OFF = "pilltab_02_right_off";
private const string MY_ROTATION_ALL_PACK_SPRITE = "btn_check_";
private const string BUTTON_SPRITE_FOOTER_OFF = "off";
private const string BUTTON_SPRITE_FOOTER_ON = "on";
private readonly Vector3 MY_ROTATION_FORMAT_ICON_POSITION = new Vector3(45f, -47f, 0f);
private readonly Vector3 MY_ROTATION_CARD_NUMBER_ICON_POSITION = new Vector3(68f, -62f, -1f);
@@ -226,12 +210,6 @@ public class DeckCardEditUI : CardSelectListUIBase
private readonly Vector3 MY_ROTATION_CARD_NUMBER_MAX_POSITION = new Vector3(58f, 0f, 0f);
private const int MY_ROTATION_CLASS_NAME_WIDTH = 107;
private const int MY_ROTATION_CLASS_UNDER_LINE_WIDTH = 184;
private const float BACK_BUTTON_POS_Y = -40.7f;
[SerializeField]
private DeckBuildShortageCardView _prefabShortageCardView;
@@ -429,12 +407,8 @@ public class DeckCardEditUI : CardSelectListUIBase
}
}
public bool IsCraftMode => _deckCardBundle.IsCraftMode;
public bool IsBattleRetry { get; set; }
public bool IsEditState => m_state == _stateEdit;
public event Action<int> OnChangeDeckCardNum;
private DeckData GetDeck(Format format, int deckId)
@@ -464,81 +438,6 @@ public class DeckCardEditUI : CardSelectListUIBase
UIManager.GetInstance().OverrideSceneParam(UIManager.ViewScene.DeckList, new DeckListUIParam(deck.Format, conventionDeckList?.Conventioninfo));
}
public static void SetDeckCopyParameter(DeckData deck, bool isCreatedByBuilder, bool isCopySubClass, ConventionDeckList conventionDeckList, MyRotationInfo myRotationInfo = null)
{
CopySrcDeckData = deck;
ClassSet = new ClassSet(deck.GetDeckClassID(), deck.GetDeckSubClassID());
IsCopySkinAndSleeve = PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SLEEVE_AND_SKIN);
IsCopySubClass = isCopySubClass;
IsCreatedByBuilder = isCreatedByBuilder;
_conventionDeckList = conventionDeckList;
CanUseNonPossessionCard = conventionDeckList == null;
if (deck.DeckAttributeType == DeckAttributeType.TrialDeck || deck.DeckAttributeType == DeckAttributeType.SampleDeck)
{
IsCreatedByBuilder = true;
}
if (myRotationInfo == null)
{
MyRotationInfo = Data.MyRotationAllInfo.Get(deck.MyRotationId);
}
else
{
MyRotationInfo = myRotationInfo;
}
}
public static void SetCreateAutoParameter(Format format, bool canUseNonPossessionCard)
{
IsCreateAuto = true;
CanUseNonPossessionCard = canUseNonPossessionCard;
}
public static void SetDeckCopyParameterForDeckIntroduction(DeckData emptyDeck, DeckData srcDeck, MyRotationInfo myRotationInfo = null)
{
CurrentDeckName = null;
CurrentDeckId = emptyDeck.GetDeckID();
CurrentDeckData = emptyDeck;
EditDeckFormat = emptyDeck.Format;
ClassSet = new ClassSet(srcDeck.GetDeckClassID(), srcDeck.GetDeckSubClassID());
CopySrcDeckData = srcDeck;
IsCopySkinAndSleeve = false;
IsCopySubClass = FormatBehaviorManager.GetDefaultBehaviour(srcDeck.Format).UseSubClass && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS);
IsCreatedByBuilder = true;
IsCreateAuto = false;
_conventionDeckList = null;
CanUseNonPossessionCard = true;
if (EditDeckFormat == Format.MyRotation)
{
if (myRotationInfo == null)
{
MyRotationInfo = Data.MyRotationAllInfo.Get(srcDeck.MyRotationId);
}
else
{
MyRotationInfo = myRotationInfo;
}
}
UIManager.GetInstance().OverrideSceneParam(UIManager.ViewScene.DeckList, new DeckListUIParam(emptyDeck.Format, null));
}
public static void SetBuildDeckEditParameter(DeckData buildDeck, string deckName, DeckData emptyDeck)
{
CurrentDeckName = deckName;
CurrentDeckId = emptyDeck.GetDeckID();
CurrentDeckData = emptyDeck;
ClassSet = new ClassSet(buildDeck.GetDeckClassID(), buildDeck.GetDeckSubClassID());
EditDeckFormat = emptyDeck.Format;
CopySrcDeckData = buildDeck;
IsCopySkinAndSleeve = false;
IsCopySubClass = FormatBehaviorManager.GetDefaultBehaviour(buildDeck.Format).UseSubClass && PlayerPrefsWrapper.GetBool(PlayerPrefsWrapper.IS_COPY_SUBCLASS_CARDS);
IsCreatedByBuilder = true;
IsCreateAuto = false;
_conventionDeckList = null;
CanUseNonPossessionCard = true;
MyRotationInfo = null;
UIManager.GetInstance().OverrideSceneParam(UIManager.ViewScene.DeckList, new DeckListUIParam(emptyDeck.Format, null));
}
public override bool IsEnableSwipeAutoSameBasicCardAdd()
{
return true;
@@ -789,7 +688,7 @@ public class DeckCardEditUI : CardSelectListUIBase
private void SetupDeckViewerAndText()
{
m_labelDeckName.text = _deckCardBundle.DeckName;
m_labelClassName.text = GameMgr.GetIns().GetDataMgr().GetClanNameByKey((int)ClassSet.MainClass);
m_labelClassName.text = ((int)ClassSet.MainClass).ToString(); // Pre-Phase-5b: no clan-name lookup
_deckViewer.RemoveData();
_deckViewer.SetDeckName(_deckCardBundle.DeckName);
_deckViewer.SetClassSet(ClassSet);
@@ -913,18 +812,6 @@ public class DeckCardEditUI : CardSelectListUIBase
InitUseSubClassDisplay();
}
public void OnBtnPushSelectCardFilter()
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
ShowFilterMenu(_selectCardFilter, Data.SystemText.Get("Card_0126"));
}
public void OnBtnPushOwnFilter()
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
ShowFilterMenu(_pagingFilter, Data.SystemText.Get("Card_0021"));
}
protected override void OnFinishFadeIn()
{
_fadeInFinish = true;
@@ -953,13 +840,6 @@ public class DeckCardEditUI : CardSelectListUIBase
return false;
}
public bool LoadDeckCard(List<int> idList)
{
base.IsLoading = true;
HideDetail();
return _deckCardBundle.LoadDeckCard(idList);
}
public void ChangeCraftMode(bool isCraft)
{
if (!base.IsLoading && base.CurrentState == _stateEdit)
@@ -967,7 +847,7 @@ public class DeckCardEditUI : CardSelectListUIBase
base.IsLoading = true;
m_craftOnBtn.normalSprite = (isCraft ? "pilltab_02_right_on" : "pilltab_02_right_off");
m_craftOffBtn.normalSprite = (isCraft ? "pilltab_02_left_off" : "pilltab_02_left_on");
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_TOGGLE_ON);
_deckCardBundle.ChangeCraftMode(isCraft);
}
}
@@ -1035,7 +915,7 @@ public class DeckCardEditUI : CardSelectListUIBase
bool flag = false;
if (ConventionInfo == null)
{
deckUpdateTask = GameMgr.GetIns().GetDeckUpdateTask();
deckUpdateTask = null; // Pre-Phase-5b: no DeckUpdateTask headless
flag = deckUpdateTask.AchievedInfo._rewards.Count > 0;
}
if (flag)
@@ -1090,7 +970,7 @@ public class DeckCardEditUI : CardSelectListUIBase
private void ChangeSceneToBattle()
{
DataMgr dataManager = GameMgr.GetIns().GetDataMgr();
DataMgr dataManager = null; // Pre-Phase-5b: headless has no DataMgr
DeckInfoTask task = new DeckInfoTask();
task.SetParameter(Format.All);
UIManager.GetInstance().StartCoroutine(Toolbox.NetworkManager.Connect(task, delegate
@@ -1111,7 +991,7 @@ public class DeckCardEditUI : CardSelectListUIBase
private string GetSaveAndRetryDialogText()
{
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
DataMgr dataMgr = null; // Pre-Phase-5b: DataMgr not reachable in DeckCardEdit UI headless
switch (dataMgr.m_BattleType)
{
case DataMgr.BattleType.FreeBattle:
@@ -1141,7 +1021,7 @@ public class DeckCardEditUI : CardSelectListUIBase
private string GetRetryDialogText()
{
DataMgr dataMgr = GameMgr.GetIns().GetDataMgr();
DataMgr dataMgr = null; // Pre-Phase-5b: DataMgr not reachable in DeckCardEdit UI headless
switch (dataMgr.m_BattleType)
{
case DataMgr.BattleType.FreeBattle:
@@ -1300,34 +1180,9 @@ public class DeckCardEditUI : CardSelectListUIBase
UpdateCraftShortageButton();
}
private void OnChangeManyDeckCards()
{
_hasChanged = true;
m_costCurve.Refresh(_deckCardBundle.SelectionAreaList.IdList.ToArray());
DeckCardNumAnim();
UpdateCraftShortageButton();
}
public void SetAllDeckCards(List<int> cardIdList, Action onFirstAnimationFinish = null, float cardRotateDelayTimeMax = float.MaxValue)
{
_deckCardBundle.SetSelectionArea(cardIdList, onFirstAnimationFinish, cardRotateDelayTimeMax);
OnChangeManyDeckCards();
}
public void RemoveAllDeckCards()
{
_deckCardBundle.ClearSelectionArea();
OnChangeManyDeckCards();
}
public CardBundle GetDeckCardBundle()
{
return _deckCardBundle.SelectionAreaList;
}
private void OnClickAutoDeckBtn(GameObject obj)
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
if (Data.MaintenanceCodeList.Contains(NetworkDefine.MAINTENANCE_TYPE.AUTO_DECK_CREATE))
{
DialogBase dialogBase = UIManager.GetInstance().CreateConfirmationDialog(Data.SystemText.Get("Card_0266"));
@@ -1379,7 +1234,7 @@ public class DeckCardEditUI : CardSelectListUIBase
private void OnClickSaveBtn(GameObject obj)
{
SaveDeck();
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
}
private DeckData CreateDeckData()
@@ -1408,15 +1263,11 @@ public class DeckCardEditUI : CardSelectListUIBase
HideDetail();
_deckViewer.gameObject.SetActive(value: true);
_deckViewer.SetDeck(CreateDeckData(), _conventionDeckList);
if (QRCodeUtility.IsShowQRCode(_deckViewer, _formatBehavior, base.Format))
{
_deckViewer.SetQRSmallTexture();
}
else if (_formatBehavior.CanShowQRCode)
if (_formatBehavior.CanShowQRCode)
{
_deckViewer.SetQRCodeButtonToGray();
}
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
}
private void HideDeckViewer()
@@ -1427,7 +1278,7 @@ public class DeckCardEditUI : CardSelectListUIBase
private void OnClickCraftShortageCardButton(GameObject obj)
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
if (!CanUseNonPossessionCard || base.IsLoading)
{
return;
@@ -1475,7 +1326,7 @@ public class DeckCardEditUI : CardSelectListUIBase
dialogBase.SetSize(DialogBase.Size.XL);
dialogBase.SetTitleLabel(Data.SystemText.Get("Dia_DeckEdit_014_Title"));
dialogBase.SetPanelDepth(100);
dialogBase.OpenSe = Se.TYPE.NONE;
dialogBase.OpenSe = 0;
DeckBuildShortageCardView _shortageCardView = UnityEngine.Object.Instantiate(_prefabShortageCardView);
dialogBase.SetObj(_shortageCardView.gameObject);
dialogBase.OnCloseStart = CloseShortageCardViewer;
@@ -1519,7 +1370,7 @@ public class DeckCardEditUI : CardSelectListUIBase
dialogBase.SetButtonLayout(DialogBase.ButtonLayout.OkBtn);
List<int> addIdList = _shortageIdList.FindAll(delegate(int id)
{
if (GameMgr.GetIns().GetDataMgr().IsMaintenanceCard(id))
if (false /* Pre-Phase-5b: IsMaintenanceCard headless-false */)
{
return false;
}
@@ -1623,7 +1474,7 @@ public class DeckCardEditUI : CardSelectListUIBase
if (_deckViewer.isActiveAndEnabled)
{
HideDeckViewer();
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_BTN_CANCEL);
return false;
}
if (_hasChanged && DeckCardNum > 0)
@@ -1709,7 +1560,7 @@ public class DeckCardEditUI : CardSelectListUIBase
List<int> list = new List<int>();
List<int> source = deckCardList.ConvertAll((int id) => CardMaster.GetInstance(formatBehavior.CardMasterId).GetCardParameterFromId(id).BaseCardId);
List<int> needBaseIdList = source.Distinct().ToList();
Dictionary<int, int> possessionBaseCardDictionary = GameMgr.GetIns().GetDataMgr().GetPossessionBaseCardDictionary(isIncludingSpotCard: true, formatBehavior.CardMasterId);
Dictionary<int, int> possessionBaseCardDictionary = new(); // Pre-Phase-5b: possession lookup not reachable headless
int i;
for (i = 0; i < needBaseIdList.Count; i++)
{
@@ -1799,7 +1650,7 @@ public class DeckCardEditUI : CardSelectListUIBase
private void OnClickSwapClassButton(GameObject obj)
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
DialogBase dialogBase = UIManager.GetInstance().CreateDialogClose();
dialogBase.SetTitleLabel(Data.SystemText.Get("Card_0274"));
dialogBase.SetText(Data.SystemText.Get("Card_0275"));
@@ -1813,7 +1664,7 @@ public class DeckCardEditUI : CardSelectListUIBase
private void OnClickMyRotationChangeButton(GameObject g)
{
GameMgr.GetIns().GetSoundMgr().PlaySe(Se.TYPE.SYS_COMMON_BUTTON);
MyRotationPeriodSelectDialog.Create(_myRotationInfo, ClassSet.MainClass, delegate(MyRotationInfo selectData)
{
if (_myRotationInfo.Id != selectData.Id)

View File

@@ -236,7 +236,7 @@ public class DeckSave
}
else
{
DeckUpdateTask deckUpdateTask = GameMgr.GetIns().GetDeckUpdateTask();
DeckUpdateTask deckUpdateTask = null; // Pre-Phase-5b: no wire task headless
if (_formatBehavior.UseSubClass)
{
deckUpdateTask.SetParameterWithSubClass(_id, _class, _subClass, _rawSkinId, _isRandomLeaderSkin, _leaderSkinIdList.ToArray(), _sleeveId, _name, isDelete: false, _deck, _format);