Files
Continentis/Assets/Scripts/MainGame/UI/CombatMainPage/CombatMainPage.cs

66 lines
2.3 KiB
C#
Raw Normal View History

2025-10-03 00:02:43 -04:00
using System;
2025-10-23 00:49:44 -04:00
using Continentis.MainGame.Combat;
2025-10-03 00:02:43 -04:00
using Lean.Pool;
using UnityEngine;
using UnityEngine.UI;
namespace Continentis.MainGame.UI
{
2025-10-23 00:49:44 -04:00
public class CombatMainPage : UIPageBase
2025-10-03 00:02:43 -04:00
{
public RectTransform dropZone;
public DrawPile drawPile;
public HandPile handPile;
public DiscardPile discardPile;
public ExhaustPile exhaustPile;
2025-10-30 23:31:29 -04:00
public GravePile gravePile;
2025-10-03 00:02:43 -04:00
public TeamSwitchButton teamSwitchButton;
public HandCardSelectionInterface handCardSelector;
2025-10-23 00:49:44 -04:00
public CustomCardSelectionInterface customCardSelector;
2025-10-03 00:02:43 -04:00
public CombatResourcesDisplayer combatResourcesDisplayer;
2025-10-23 00:49:44 -04:00
public ActionOrderDisplayer actionOrderDisplayer;
2025-10-03 00:02:43 -04:00
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));
2025-10-30 23:31:29 -04:00
gravePile.cardViews.ForEach(c => LeanPool.Despawn(c.gameObject));
2025-10-03 00:02:43 -04:00
drawPile.cardViews.Clear();
handPile.cardViews.Clear();
discardPile.cardViews.Clear();
exhaustPile.cardViews.Clear();
2025-10-30 23:31:29 -04:00
gravePile.cardViews.Clear();
2025-10-03 00:02:43 -04:00
}
public PileBase Pile(string pileName)
{
switch (pileName)
{
case "Draw":
return drawPile;
case "Hand":
return handPile;
case "Discard":
return discardPile;
case "Exhaust":
return exhaustPile;
2025-10-30 23:31:29 -04:00
case "Grave":
return gravePile;
2025-10-03 00:02:43 -04:00
case "Intention":
throw new NotImplementedException("Intention pile UI is in HUD, not in DeckPage.");
default:
throw new ArgumentOutOfRangeException(nameof(pileName), pileName, null);
}
}
}
}