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;
                }
            }
        }
Beispiel #2
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);
            }
        }