Files
Continentis/Assets/Scripts/MainGame/UI/DeckUIPage/DeckPage.cs
SoulliesOfficial 9b1b5ca93f initial
2025-10-03 00:02:43 -04:00

58 lines
1.9 KiB
C#

using System;
using Lean.Pool;
using UnityEngine;
using UnityEngine.UI;
namespace Continentis.MainGame.UI
{
public class DeckPage : UIPageBase
{
public RectTransform dropZone;
public DrawPile drawPile;
public HandPile handPile;
public DiscardPile discardPile;
public ExhaustPile exhaustPile;
public TeamSwitchButton teamSwitchButton;
public HandCardSelectionInterface handCardSelector;
public CombatResourcesDisplayer combatResourcesDisplayer;
public Button endActionButton;
protected override void Awake()
{
base.Awake();
endActionButton.onClick.AddListener(CombatMainManager.Instance.EndAction);
}
public void ClearAllCardViews()
{
drawPile.cardViews.ForEach(c => LeanPool.Despawn(c.gameObject));
handPile.cardViews.ForEach(c => LeanPool.Despawn(c.gameObject));
discardPile.cardViews.ForEach(c => LeanPool.Despawn(c.gameObject));
exhaustPile.cardViews.ForEach(c => LeanPool.Despawn(c.gameObject));
drawPile.cardViews.Clear();
handPile.cardViews.Clear();
discardPile.cardViews.Clear();
exhaustPile.cardViews.Clear();
}
public PileBase Pile(string pileName)
{
switch (pileName)
{
case "Draw":
return drawPile;
case "Hand":
return handPile;
case "Discard":
return discardPile;
case "Exhaust":
return exhaustPile;
case "Intention":
throw new NotImplementedException("Intention pile UI is in HUD, not in DeckPage.");
default:
throw new ArgumentOutOfRangeException(nameof(pileName), pileName, null);
}
}
}
}