Add round number to BattleState
This commit is contained in:
parent
b654419966
commit
8a86423e7d
2 changed files with 21 additions and 7 deletions
|
|
@ -9,6 +9,7 @@ public class BattleState
|
|||
// public event BattleStateChangedAction OnBattleStateChanged;
|
||||
private bool heroTurn;
|
||||
private bool playedEmotion;
|
||||
private int round = 0;
|
||||
|
||||
public bool IsTeamsTurn(TeamChoice team) {
|
||||
if (team == TeamChoice.Heroes) {
|
||||
|
|
@ -31,11 +32,23 @@ public class BattleState
|
|||
this.playedEmotion = true;
|
||||
}
|
||||
|
||||
public bool HeroTurn {
|
||||
get => this.heroTurn;
|
||||
set {
|
||||
this.heroTurn = value;
|
||||
this.playedEmotion = false;
|
||||
public bool HeroTurn {get => this.heroTurn;}
|
||||
|
||||
public int Round {get => this.round;}
|
||||
|
||||
public void AdvanceToTeamTurn(TeamChoice team) {
|
||||
if (team == TeamChoice.Heroes) {
|
||||
if (this.heroTurn) {
|
||||
throw new System.InvalidOperationException("Already in hero turn");
|
||||
}
|
||||
this.heroTurn = true;
|
||||
this.round++;
|
||||
} else {
|
||||
if (!this.heroTurn) {
|
||||
throw new System.InvalidOperationException("Already in monster turn");
|
||||
}
|
||||
this.heroTurn = false;
|
||||
}
|
||||
this.playedEmotion = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue