Move InsightLevel into BattleState
This commit is contained in:
parent
cb88ae78b6
commit
c2fc8b0904
3 changed files with 10 additions and 8 deletions
|
|
@ -7,7 +7,6 @@ using UnityEngine.SceneManagement;
|
|||
public class BattleController : MonoBehaviour, IBattleEffectApplier, IBattleEffectResolver, MonsterViewpoint
|
||||
{
|
||||
private bool STABLE_HAND_STYLE = true;
|
||||
private int STARTING_INSIGHT = 3;
|
||||
|
||||
// Inspector public
|
||||
public GameObject uiCanvas;
|
||||
|
|
@ -25,7 +24,6 @@ public class BattleController : MonoBehaviour, IBattleEffectApplier, IBattleEffe
|
|||
private BattleMonster[] monsters;
|
||||
|
||||
private BattleState state;
|
||||
private InsightLevel insightLevel;
|
||||
private HandPlayability<HeroCard> heroHandPlayability;
|
||||
private HandPlayability<MonsterCard> monsterHandPlayability;
|
||||
private TurnIntentions<MonsterCard> monsterIntentions;
|
||||
|
|
@ -49,8 +47,6 @@ public class BattleController : MonoBehaviour, IBattleEffectApplier, IBattleEffe
|
|||
this.heroEnergyUI.Init(this.state.HeroEnergy);
|
||||
this.monsterEnergyUI.Init(this.state.MonsterEnergy);
|
||||
|
||||
this.insightLevel = new InsightLevel(STARTING_INSIGHT);
|
||||
|
||||
this.heroes = new BattleHero[parameters.HeroIds.Length];
|
||||
for (int i = 0; i < this.heroes.Length; i++) {
|
||||
HeroId id = parameters.HeroIds[i];
|
||||
|
|
@ -98,10 +94,9 @@ public class BattleController : MonoBehaviour, IBattleEffectApplier, IBattleEffe
|
|||
this.state.MonsterDeck, this.state.MonsterEnergy, this.monsterHandPlayability);
|
||||
|
||||
this.battlePlayerControls.Init(
|
||||
this.state.HeroDeck, this.state.MonsterDeck, this.state.PlayArea, this.insightLevel,
|
||||
this.state.HeroDeck, this.state.MonsterDeck, this.state.PlayArea, this.state.InsightLevel,
|
||||
this.heroHandPlayability, this.monsterHandPlayability, this.monsterIntentions,
|
||||
this.uiCanvas.transform.localScale.x);
|
||||
this.insightLevel.OnChanged += this.battlePlayerControls.NotifyInsightLevelChanged;
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
|
|
@ -114,7 +109,7 @@ public class BattleController : MonoBehaviour, IBattleEffectApplier, IBattleEffe
|
|||
BattleResult.FinishBattle(new BattleResult(true));
|
||||
};
|
||||
cheat.OnInsightCode += delegate {
|
||||
this.insightLevel.Modify(+5);
|
||||
this.state.InsightLevel.Modify(+5);
|
||||
};
|
||||
cheat.OnOneHPCode += delegate {
|
||||
foreach (BattleMonster m in this.monsters) {
|
||||
|
|
@ -398,7 +393,7 @@ public class BattleController : MonoBehaviour, IBattleEffectApplier, IBattleEffe
|
|||
}
|
||||
|
||||
public void ModifyInsight(ModifyInsightEffect effect) {
|
||||
this.insightLevel.Modify(effect.Amount);
|
||||
this.state.InsightLevel.Modify(effect.Amount);
|
||||
}
|
||||
|
||||
public void DrawCards(DrawCardsEffect effect) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue