Files
Continentis/Assets/Scripts/MainGame/UI/CombatMainPage/CombatMainPage.cs
SoulliesOfficial 5d09ef7b53 到IronWall
2025-10-30 23:31:29 -04:00

66 lines
2.3 KiB
C#

using System;
using Continentis.MainGame.Combat;
using Lean.Pool;
using UnityEngine;
using UnityEngine.UI;
namespace Continentis.MainGame.UI
{
public class CombatMainPage : UIPageBase
{
public RectTransform dropZone;
public DrawPile drawPile;
public HandPile handPile;
public DiscardPile discardPile;
public ExhaustPile exhaustPile;
public GravePile gravePile;
public TeamSwitchButton teamSwitchButton;
public HandCardSelectionInterface handCardSelector;
public CustomCardSelectionInterface customCardSelector;
public CombatResourcesDisplayer combatResourcesDisplayer;
public ActionOrderDisplayer actionOrderDisplayer;
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));
gravePile.cardViews.ForEach(c => LeanPool.Despawn(c.gameObject));
drawPile.cardViews.Clear();
handPile.cardViews.Clear();
discardPile.cardViews.Clear();
exhaustPile.cardViews.Clear();
gravePile.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 "Grave":
return gravePile;
case "Intention":
throw new NotImplementedException("Intention pile UI is in HUD, not in DeckPage.");
default:
throw new ArgumentOutOfRangeException(nameof(pileName), pileName, null);
}
}
}
}