コード例 #1
0
 Controller(IPlayerInfoHolder playerInfoHolder, IGameInfoHolder gameInfoHolder, IExperienceHandler experienceHandler)
 {
     _playerInfoHolder  = playerInfoHolder;
     _experienceHandler = experienceHandler;
     _gameInfoHolder    = gameInfoHolder;
     _playerInfoHolder.PersonalLifeChanged += SetPersonalLife;
     _experienceHandler.ExperienceChanged  += SetMarks;
     _playerInfoHolder.CoinsChanged        += ShowBalance;
     _playerInfoHolder.CourseChanged       += SetSemester;
     _playerInfoHolder.UniversityChanged   += ShowUniversityCount;
     _playerInfoHolder.ChangedPosition     += SetPosition;
 }
コード例 #2
0
        public TasksHandler(AsyncProcessor asyncProcessor, IPlayerInfoHolder playerInfoHolder, IExperienceHandler experienceHandler, IGameInfoHolder gameInfoHolder)
        {
            _asyncProcessor    = asyncProcessor;
            _experienceHandler = experienceHandler;
            _gameInfoHolder    = gameInfoHolder;
            _playerInfoHolder  = playerInfoHolder;
            _takenTasksTimes   = new Queue <int>();
            for (int i = 0; i < _playerInfoHolder.TasksTaken; i++)
            {
                _takenTasksTimes.Enqueue(_gameInfoHolder.TaskTimes[UnityEngine.Random.Range(0, _gameInfoHolder.TaskTimes.Length)]);
            }
            if (_timer == null && _playerInfoHolder.TasksTaken > 0)

            {
                _timer = _asyncProcessor.StartCoroutine(Timer());
            }
        }