using System; using System.Collections.Generic; using System.Linq; using Cute; using UnityEngine; using Wizard.DeckSelect.FirstDisplayPageIndexGetter; namespace Wizard; public class DeckSelectUI : MonoBehaviour { public class InitOptions { } private enum ChangeMoveDirection { NONE, RIGHT } public class PageData { public Format Format { get; private set; } public DeckAttributeType AttributeType { get; private set; } public string GroupName { get; private set; } public List DeckViewList { get; private set; } private PageData(List deckViewList, Format format, DeckAttributeType attributeType, string groupName) { DeckViewList = deckViewList; Format = format; AttributeType = attributeType; GroupName = groupName; } } private class DeckTable { private List _deckUIList = new List(); private Action _onUpdateDeckUICustomize; public GameObject Obj { get; private set; } public DeckTable(UIGrid uiGrid, DeckUI originalDeckUI, Action onClick, Action onDrag, Action onUpdateDeckUICustomize) { _onUpdateDeckUICustomize = onUpdateDeckUICustomize; for (int i = 0; i < 9; i++) { DeckUI component = NGUITools.AddChild(uiGrid.gameObject, originalDeckUI.gameObject).GetComponent(); component.Initialize(onClick); UIEventListener uIEventListener = UIEventListener.Get(component.gameObject); uIEventListener.onDrag = (UIEventListener.VectorDelegate)Delegate.Combine(uIEventListener.onDrag, (UIEventListener.VectorDelegate)delegate(GameObject g, Vector2 v) { onDrag.Call(v); }); _deckUIList.Add(component); component.gameObject.SetActive(value: false); } uiGrid.repositionNow = true; Obj = uiGrid.gameObject; Obj.SetActive(value: true); } public void UpdateDeckViewList(List deckViewList, bool canUseNonPossessionCard) { for (int i = 0; i < _deckUIList.Count; i++) { if (deckViewList.Count > i) { DeckUI deckUI = _deckUIList[i]; deckUI.gameObject.SetActive(value: true); deckUI.UpdateView(deckViewList[i], canUseNonPossessionCard); _onUpdateDeckUICustomize.Call(deckUI); } else { _deckUIList[i].gameObject.SetActive(value: false); } } } } private static readonly Vector3 VIEW_PAGE_POSITION = Vector3.zero; private static readonly Vector3 OUTSIDE_RIGHT_PAGE_POSITION = VIEW_PAGE_POSITION + Vector3.right * 1400f; private static readonly Vector3 OUTSIDE_LEFT_PAGE_POSITION = VIEW_PAGE_POSITION + Vector3.left * 1400f; private DeckTable[] _deckTables = new DeckTable[2]; private int _deckTableIndex; private List _pageList; private bool _canUseNonPossessionCard; public bool IsPageMoving { get; private set; } }