Example #1
0
        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);
        }
Example #2
0
 public void CheckRoom()
 {
     if (MapManager.DoesEnemyExists())
     {
         OnStageChange?.Invoke(this, GameState.BattleBegin);
     }
     else
     {
         ChangeState(GameState.Movable);
     }
 }
Example #3
0
        /* 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;
        }
Example #4
0
        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);
        }
Example #5
0
        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);
        }