Remove PlayMode enum requirement. Clean things up a lot.

This commit is contained in:
smoogipooo
2017-03-12 14:32:50 +09:00
parent b0ea282a06
commit 3480dca0ad
15 changed files with 51 additions and 100 deletions

View File

@ -1,20 +1,16 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Game.Modes;
using osu.Game.Modes.Objects;
using System;
using System.Collections.Generic;
namespace osu.Game.Beatmaps
{
public abstract class DifficultyCalculator
{
protected abstract PlayMode PlayMode { get; }
protected double TimeRate = 1;
protected abstract double CalculateInternal(Dictionary<String, String> categoryDifficulty);
protected abstract double CalculateInternal(Dictionary<string, string> categoryDifficulty);
private void loadTiming()
{
@ -37,12 +33,14 @@ namespace osu.Game.Beatmaps
protected DifficultyCalculator(Beatmap beatmap)
{
Objects = beatmap.ConvertTo<T>(PlayMode).HitObjects;
Objects = CreateBeatmapConverter().Convert(beatmap).HitObjects;
PreprocessHitObjects();
}
protected virtual void PreprocessHitObjects()
{
}
protected abstract IBeatmapConverter<T> CreateBeatmapConverter();
}
}