public bool NextStage() { if (IsEnded) { return(false); } if (GoodPrecent < BadPrecent) { IsFailed = true; OnFailed?.Invoke(this); return(false); } if (_stagesQueue.Count > 1) { _stagesQueue.Dequeue(); OnStageChange?.Invoke(this); } else { IsFinite = true; OnStageChange?.Invoke(this); OnFinite?.Invoke(this); } return(true); }
public void CheckRoom() { if (MapManager.DoesEnemyExists()) { OnStageChange?.Invoke(this, GameState.BattleBegin); } else { ChangeState(GameState.Movable); } }
/* Inner commands */ private void ChangeState(EmulatorStatus s) { //Notify client of this change. OnStageChange e = new OnStageChange { old_status = status, new_status = s }; SendData(e, WebReplyType.OnStatusChange); status = s; }
public void ChangeState(GameState gameState) { Debug.Log($"[{this.GetType().Name}] State changed from {GameState} to {gameState}"); if (gameState == GameState.InitializeFinished) { OnStageChange?.Invoke(this, gameState); ChangeState(GameState.Movable); return; } GameState = gameState; OnStageChange?.Invoke(this, gameState); }
void Start() { Debug.Log("Start game"); // Setup Managers MapManager.Setup(this); UserManager.Setup(this); DialogManager.Setup(this); RuleManager.Setup(this); GameUIManager.Setup(this); MonsterCardManager.Setup(this); CardAnimationFactory = new CardAnimationFactory(); OnStageChange += (object sender, GameState gs) => { Debug.Log($"[{this.GetType().Name}] State changed from {GameState} to {gs}"); }; OnStageChange?.Invoke(this, GameState.Intro); }