73 lines
2.5 KiB
C#
73 lines
2.5 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 RoundHint roundHint;
|
|
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();
|
|
|
|
drawPile.UpdateCountText();
|
|
handPile.UpdateCountText();
|
|
discardPile.UpdateCountText();
|
|
exhaustPile.UpdateCountText();
|
|
gravePile.UpdateCountText();
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|
|
}
|
|
} |