Add helper method to convert to legacy mods enums

This commit is contained in:
Dean Herbert
2020-03-24 12:06:24 +09:00
parent e5f4d8686e
commit 546772192c
8 changed files with 151 additions and 9 deletions

View File

@ -0,0 +1,35 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.IO;
namespace osu.Game.Scoring.Legacy
{
public class LegacyScoreEncoder
{
public const int LATEST_VERSION = 128;
private readonly Score score;
public LegacyScoreEncoder(Score score)
{
this.score = score;
if (score.ScoreInfo.Beatmap.RulesetID < 0 || score.ScoreInfo.Beatmap.RulesetID > 3)
throw new ArgumentException("Only scores in the osu, taiko, catch, or mania rulesets can be encoded to the legacy score format.", nameof(score));
}
public void Encode(TextWriter writer)
{
writer.WriteLine($"osu file format v{LATEST_VERSION}");
writer.WriteLine();
handleGeneral(writer);
}
private void handleGeneral(TextWriter writer)
{
}
}
}