Implement Meditate

This commit is contained in:
henriquenakashima 2020-09-22 01:09:20 -04:00
parent 03ca23d484
commit ceb46f98b2
14 changed files with 207 additions and 28 deletions

View file

@ -20,22 +20,27 @@ public class BattlePlayerControls : MonoBehaviour
private BattleDeck<HeroCard> heroDeck;
private BattleDeck<MonsterCard> monsterDeck;
private PlayArea playArea;
private InsightLevel insightLevel;
private HandControls<HeroCard> heroHandControls;
private HandControls<MonsterCard> monsterHandControls;
private Dictionary<BaseCard, GameObject> cardsInPlayUIs;
public void Init(
BattleDeck<HeroCard> heroDeck, BattleDeck<MonsterCard> monsterDeck, PlayArea playArea) {
BattleDeck<HeroCard> heroDeck, BattleDeck<MonsterCard> monsterDeck, PlayArea playArea,
InsightLevel insightLevel) {
this.heroDeck = heroDeck;
this.monsterDeck = monsterDeck;
this.playArea = playArea;
this.insightLevel = insightLevel;
this.heroHandControls = new HandControls<HeroCard>(this.uiCanvas, this.cardPrefab, HandControlsPosition.Bottom, int.MaxValue);
this.heroHandControls.OnCardClicked += OnHeroCardClicked;
this.monsterHandControls = new HandControls<MonsterCard>(this.uiCanvas, this.cardPrefab, HandControlsPosition.Top, 1);
this.monsterHandControls.OnCardClicked += OnMonsterCardClicked;
this.cardsInPlayUIs = new Dictionary<BaseCard, GameObject>();
NotifyInsightLevelChanged();
}
// Start is called before the first frame update
@ -143,4 +148,8 @@ public class BattlePlayerControls : MonoBehaviour
Screen.height - PADDING - DELTA * index - BattleCardPrefabConstants.CARD_HEIGHT / 2,
0);
}
public void NotifyInsightLevelChanged() {
this.monsterHandControls.InsightLevel = this.insightLevel.Level;
}
}