Example #1
0
        public BeatmapManager(Storage storage, IDatabaseContextFactory contextFactory, RulesetStore rulesets, IAPIProvider api, [NotNull] AudioManager audioManager, IResourceStore <byte[]> resources, GameHost host = null,
                              WorkingBeatmap defaultBeatmap = null, bool performOnlineLookups = false)
        {
            beatmapModelManager    = CreateBeatmapModelManager(storage, contextFactory, rulesets, api, host);
            beatmapModelDownloader = CreateBeatmapModelDownloader(beatmapModelManager, api, host);
            workingBeatmapCache    = CreateWorkingBeatmapCache(audioManager, resources, new FileStore(contextFactory, storage).Store, defaultBeatmap, host);

            workingBeatmapCache.BeatmapManager = beatmapModelManager;

            if (performOnlineLookups)
            {
                onlineBetamapLookupQueue = new BeatmapOnlineLookupQueue(api, storage);
                beatmapModelManager.OnlineLookupQueue = onlineBetamapLookupQueue;
            }
        }
Example #2
0
        public BeatmapManager(Storage storage, IDatabaseContextFactory contextFactory, RulesetStore rulesets, IAPIProvider api, [NotNull] AudioManager audioManager, IResourceStore <byte[]> gameResources, GameHost host = null, WorkingBeatmap defaultBeatmap = null, bool performOnlineLookups = false, AudioMixer mainTrackMixer = null)
        {
            var userResources = new FileStore(contextFactory, storage).Store;

            BeatmapTrackStore = audioManager.GetTrackStore(userResources);

            beatmapModelManager    = CreateBeatmapModelManager(storage, contextFactory, rulesets, api, host);
            beatmapModelDownloader = CreateBeatmapModelDownloader(beatmapModelManager, api, host);
            workingBeatmapCache    = CreateWorkingBeatmapCache(audioManager, gameResources, userResources, defaultBeatmap, host);

            workingBeatmapCache.BeatmapManager      = beatmapModelManager;
            beatmapModelManager.WorkingBeatmapCache = workingBeatmapCache;

            if (performOnlineLookups)
            {
                onlineBeatmapLookupQueue = new BeatmapOnlineLookupQueue(api, storage);
                beatmapModelManager.OnlineLookupQueue = onlineBeatmapLookupQueue;
            }
        }