void Start() { if (!DataPersistance.GameStateExists()) { throw new System.InvalidProgramException("Game state don't exist!"); } CurrentGameId = DataPersistance.GetCurrentGameId(); PopupsController = GetComponent <PopupsController>(); if (GSP.GameState.ItsMyTurn()) { if (GSP.GameState.HasNotStarted()) { GameEngine.StartGame(); } } UpdateUI(); CheckTheTurn(); if (GSP.GameState.GetAvailableActions().FindAll((Action obj) => obj.Type == ActionType.EndTurn).Count == 1) { EndTurnParticleSystemVisible = true; } else { EndTurnParticleSystemVisible = false; } }
public GameEngine() { if (!DataPersistance.GameStateExists()) { //only for debug - starting game scene List <string> nicknames = new List <string>(); nicknames.Add("ewa"); nicknames.Add("katarzyna"); var GameState = GameStateGenerator.GenerateGameState("DEBUG_ID", 2, nicknames, "ewa"); //AddDebugOptions(); StartGame(); DataPersistance.SavePlayerNickName("ewa"); GameState.SaveGameState(); } AddDebugOptions(); }