diff --git a/Assets/Battle/BattlePlayerControls.cs b/Assets/Battle/BattlePlayerControls.cs index d53f310..ebfe469 100644 --- a/Assets/Battle/BattlePlayerControls.cs +++ b/Assets/Battle/BattlePlayerControls.cs @@ -21,7 +21,7 @@ public class BattlePlayerControls : MonoBehaviour private BattleDeck monsterDeck; private PlayArea playArea; - private HeroHandControls heroHandControls; + private HandControls heroHandControls; private Dictionary cardsInPlayUIs; public void Init( @@ -30,7 +30,7 @@ public class BattlePlayerControls : MonoBehaviour this.monsterDeck = monsterDeck; this.playArea = playArea; - this.heroHandControls = new HeroHandControls(this, this.uiCanvas, this.cardPrefab); + this.heroHandControls = new HandControls(this.uiCanvas, this.cardPrefab); this.heroHandControls.OnCardClicked += OnCardClicked; this.cardsInPlayUIs = new Dictionary(); } diff --git a/Assets/Battle/HeroHandControls.cs b/Assets/Battle/HandControls.cs similarity index 83% rename from Assets/Battle/HeroHandControls.cs rename to Assets/Battle/HandControls.cs index c1a961f..dddf416 100644 --- a/Assets/Battle/HeroHandControls.cs +++ b/Assets/Battle/HandControls.cs @@ -4,9 +4,9 @@ using System.Linq; using UnityEngine; using UnityEngine.UI; -public class HeroHandControls +public class HandControls where BaseCardT : BaseCard { - public delegate void CardClickedAction(HeroCard card); + public delegate void CardClickedAction(BaseCardT card); public event CardClickedAction OnCardClicked; private GameObject uiCanvas; @@ -14,12 +14,12 @@ public class HeroHandControls private List cardsInHandUIs; - public HeroHandControls(GameObject uiCanvas, GameObject cardPrefab) { + public HandControls(GameObject uiCanvas, GameObject cardPrefab) { this.uiCanvas = uiCanvas; this.cardPrefab = cardPrefab; } - public void SetHeroHand(List hand) { + public void SetHeroHand(List hand) { if (this.cardsInHandUIs != null) { foreach (GameObject cardInHandUI in this.cardsInHandUIs) { GameObject.Destroy(cardInHandUI); @@ -28,7 +28,7 @@ public class HeroHandControls this.cardsInHandUIs = new List(); for (int i = 0; i < hand.Count; i++) { - HeroCard card = hand[i]; + BaseCardT card = hand[i]; GameObject cardUI = GameObject.Instantiate(this.cardPrefab, this.uiCanvas.transform); this.cardsInHandUIs.Add(cardUI); cardUI.transform.position = CalculateHandCardPosition(i, hand.Count); diff --git a/Assets/Battle/HeroHandControls.cs.meta b/Assets/Battle/HandControls.cs.meta similarity index 83% rename from Assets/Battle/HeroHandControls.cs.meta rename to Assets/Battle/HandControls.cs.meta index 3a012e4..06ba086 100644 --- a/Assets/Battle/HeroHandControls.cs.meta +++ b/Assets/Battle/HandControls.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ca9b72ece27ba0c44890f16beba3bbbb +guid: 69de07a1c92b9ac48be57f4c81189075 MonoImporter: externalObjects: {} serializedVersion: 2