Move things to make space for monster hand
This commit is contained in:
parent
6135ea1b24
commit
c0afc58c01
2 changed files with 22 additions and 10 deletions
|
|
@ -7,7 +7,7 @@ using UnityEngine.UI;
|
|||
public class BattlePlayerControls : MonoBehaviour
|
||||
{
|
||||
// TODO: Draw enemy permanents
|
||||
|
||||
|
||||
public BattleController battleController;
|
||||
public GameObject uiCanvas;
|
||||
public GameObject cardPrefab;
|
||||
|
|
@ -18,12 +18,15 @@ public class BattlePlayerControls : MonoBehaviour
|
|||
public event TurnPassedAction OnTurnPassed;
|
||||
|
||||
private BattleDeck<HeroCard> heroDeck;
|
||||
private BattleDeck<MonsterCard> monsterDeck;
|
||||
private List<GameObject> cardsInHandUIs;
|
||||
private PlayArea playArea;
|
||||
private Dictionary<BaseCard, GameObject> cardsInPlayUIs;
|
||||
|
||||
public void Init(BattleDeck<HeroCard> heroDeck, PlayArea playArea) {
|
||||
public void Init(
|
||||
BattleDeck<HeroCard> heroDeck, BattleDeck<MonsterCard> monsterDeck, PlayArea playArea) {
|
||||
this.heroDeck = heroDeck;
|
||||
this.monsterDeck = monsterDeck;
|
||||
this.playArea = playArea;
|
||||
|
||||
this.cardsInPlayUIs = new Dictionary<BaseCard, GameObject>();
|
||||
|
|
@ -42,7 +45,7 @@ public class BattlePlayerControls : MonoBehaviour
|
|||
|
||||
}
|
||||
|
||||
private void SetHand(List<HeroCard> hand) {
|
||||
private void SetHeroHand(List<HeroCard> hand) {
|
||||
if (this.cardsInHandUIs != null) {
|
||||
foreach (GameObject cardInHandUI in this.cardsInHandUIs) {
|
||||
Destroy(cardInHandUI);
|
||||
|
|
@ -61,6 +64,10 @@ public class BattlePlayerControls : MonoBehaviour
|
|||
}
|
||||
}
|
||||
|
||||
private void SetMonsterHand(List<MonsterCard> hand) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
private const int CARD_WIDTH = 122;
|
||||
private const int CARD_HEIGHT = 155;
|
||||
|
||||
|
|
@ -69,7 +76,7 @@ public class BattlePlayerControls : MonoBehaviour
|
|||
const int DELTA = CARD_WIDTH + SPACING;
|
||||
|
||||
return new Vector3(Screen.width * 0.5f - DELTA / 2 * (count - 1) + DELTA * index,
|
||||
160,
|
||||
SPACING + CARD_HEIGHT / 2,
|
||||
0);
|
||||
}
|
||||
|
||||
|
|
@ -105,8 +112,12 @@ public class BattlePlayerControls : MonoBehaviour
|
|||
return this.singleTargeting != null && this.singleTargeting.CanTarget(participant);
|
||||
}
|
||||
|
||||
public void NotifyHandPileChanged() {
|
||||
SetHand(this.heroDeck.GetHandPile().Cast<HeroCard>().ToList());
|
||||
public void NotifyHeroHandPileChanged() {
|
||||
SetHeroHand(this.heroDeck.GetHandPile().ToList());
|
||||
}
|
||||
|
||||
public void NotifyMonsterHandPileChanged() {
|
||||
SetMonsterHand(this.monsterDeck.GetHandPile().ToList());
|
||||
}
|
||||
|
||||
private void NotifyPlayAreaChanged() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue