Exemple #1
0
        public void Play()
        {
            StartGame();

            while (IsStillAlive())
            {
                if (FeelExhausted())
                {
                    InfoHelper.DisplayRecoverHP(_store.RecoverHP());
                }

                // make your level is as high as possible
                _store.LevelUp();
                InfoHelper.DisplayLevelUp();

                _missionBoard.RefreshMissionBoard();
                InfoHelper.DisplayMissionBoardIsRefreshed();

                // if pick nothing, The Missions Board will be refreshed.
                if (!_missionBoard.PickMissions())
                {
                    continue;
                }

                // when The Mission Board is empty, buy items and refresh the board.
                while (!_missionBoard.MissionBoardIsEmpty())
                {
                    // when the mission is failed, buy items and refresh the board.
                    if (!_missionBoard.PerformTheMission())
                    {
                        IsFailed();
                        break;
                    }

                    IsSucceeded();
                }
            }

            EndGame();
        }