mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 07:06:35 +09:00
Add helper method to convert to legacy mods enums
This commit is contained in:
35
osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs
Normal file
35
osu.Game/Scoring/Legacy/LegacyScoreEncoder.cs
Normal 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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user