예제 #1
0
        public void Update()
        {
            if (Stages_.Count == 0)
            {
                return;
            }

            if (DstStage_ != null)
            {
                if (CurStage_ != null)
                {
                    CurStage_.Exit();
                }

                PreStage_ = CurStage_;
                CurStage_ = DstStage_;
                DstStage_ = null;

                CurStage_.Enter();
                CurStage_.Update();
            }
            else if (CurStage_ != null)
            {
                CurStage_.Update();
            }
            else
            {
                if (DefaultStage_ != null)
                {
                    CurStage_ = DefaultStage_;
                    CurStage_.Enter();
                    CurStage_.Update();
                }
            }

            if (CurStage_ != null)
            {
                StageCode Code = CurStage_.CheckStage();
                if (Code == StageCode.Failed)
                {
                    TranslateTo(StageID.Error);
                }
                else if (Code == StageCode.Succeeded)
                {
                    TranslateTo(CurStage_.GetNextStageID());
                }
            }
        }