예제 #1
0
        public Clock(IAlarm alarm, IDisplay display)
        {
            _alarm         = alarm;
            _buttonManager = new ButtonManager();
            _display       = display;
            _modeManager   = new ModeManager();
            _timeManager   = new TimeManager();
            _timer         = new SixtySecondTimer();

            _buttonManager.SetModeManager(_modeManager);
            _buttonManager.SetTimeManager(_timeManager);

            _timeManager.SetAlarm(_alarm);
            _timeManager.SetDisplay(_display);
            _timeManager.SetModeManager(_modeManager);
            _timer.SetTimeManager(_timeManager);
        }
예제 #2
0
        public void CreatePlayable(IModeManager modeManager)
        {
            // Playable maps shouldn't support this action.
            if (IsPlayable)
            {
                Logger.LogWarning($"OriginalMap.CreatePlayable - This action is not supported for playable maps!");
                return;
            }

            this.playableMaps.Clear();
            foreach (var service in modeManager.PlayableServices())
            {
                var playableMap = CreatePlayable(service);
                if (playableMap != null)
                {
                    this.playableMaps[service.GameMode] = playableMap;
                }
            }
        }
예제 #3
0
        private void Init(IModeManager modeManager, IDependencyContainer dependency)
        {
            // Create user statistics for missing game modes using mode manager.
            foreach (var mode in modeManager.PlayableServices())
            {
                if (!statistics.ContainsKey(mode.GameMode))
                {
                    statistics[mode.GameMode] = new UserStatistics()
                    {
                        GameMode = mode.GameMode
                    };
                }
            }

            // Inject dependencies to all user statistics.
            foreach (var s in statistics.Values)
            {
                s.User = this;
                dependency.Inject(s);
            }
        }
예제 #4
0
 public OsuMapsetParser(IModeManager modeManager)
 {
     this.modeManager = modeManager;
 }
예제 #5
0
 public MapsetStore(IModeManager modeManager)
 {
     osuParser = new OsuMapsetParser(modeManager);
 }
예제 #6
0
 public void SetModeManager(IModeManager modeManager)
 {
     _modeManager = modeManager;
 }