Add new GameState
This commit is contained in:
@@ -9,6 +9,7 @@ namespace Enums {
|
||||
}
|
||||
|
||||
public enum GameState {
|
||||
Setup,
|
||||
Wait,
|
||||
Move
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Services {
|
||||
|
||||
#region Variables
|
||||
private readonly List<GemPresenter> gemPresenters = new List<GemPresenter>();
|
||||
private GameState currentState = GameState.Move;
|
||||
private GameState currentState = GameState.Setup;
|
||||
#endregion
|
||||
|
||||
public GameBoardService(
|
||||
@@ -91,10 +91,8 @@ namespace Services {
|
||||
}
|
||||
|
||||
SpawnCascade(gemsToSpawn);
|
||||
|
||||
this.currentState = GameState.Move;
|
||||
}
|
||||
|
||||
|
||||
private Gem SetGemAt(Vector2Int position, GemType gemType, bool isBomb = false) {
|
||||
GemTypeValues gemValue = GemUtils.GetGemValues(gemType, this.gameVariables.gemsPrefabs);
|
||||
Gem gem = new Gem(isBomb ? GemType.Bomb : gemType, position, gemValue, gemType);
|
||||
@@ -314,6 +312,9 @@ namespace Services {
|
||||
if (i < groups.Count - 1)
|
||||
await UniTask.Delay(150);
|
||||
}
|
||||
|
||||
if(this.currentState == GameState.Setup)
|
||||
this.currentState = GameState.Move;
|
||||
}
|
||||
|
||||
private void RemovePresenterFor(GemView gemView) {
|
||||
|
||||
Reference in New Issue
Block a user