mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 14:12:55 +08:00
Prefix everything inside Rulesets.Objects.Legacy with "Convert" to avoid naming clashes with Ruleset projects.
This commit is contained in:
parent
99db871e6c
commit
2af9bf1423
@ -29,7 +29,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
// TODO: Not sure how far back to go, or differences between versions
|
||||
}
|
||||
|
||||
private HitObjectParser parser;
|
||||
private ConvertHitObjectParser parser;
|
||||
|
||||
private LegacySampleBank defaultSampleBank;
|
||||
private int defaultSampleVolume = 100;
|
||||
@ -90,16 +90,16 @@ namespace osu.Game.Beatmaps.Formats
|
||||
switch (beatmap.BeatmapInfo.RulesetID)
|
||||
{
|
||||
case 0:
|
||||
parser = new Rulesets.Objects.Legacy.Osu.HitObjectParser();
|
||||
parser = new Rulesets.Objects.Legacy.Osu.ConvertHitObjectParser();
|
||||
break;
|
||||
case 1:
|
||||
parser = new Rulesets.Objects.Legacy.Taiko.HitObjectParser();
|
||||
parser = new Rulesets.Objects.Legacy.Taiko.ConvertHitObjectParser();
|
||||
break;
|
||||
case 2:
|
||||
parser = new Rulesets.Objects.Legacy.Catch.HitObjectParser();
|
||||
parser = new Rulesets.Objects.Legacy.Catch.ConvertHitObjectParser();
|
||||
break;
|
||||
case 3:
|
||||
parser = new Rulesets.Objects.Legacy.Mania.HitObjectParser();
|
||||
parser = new Rulesets.Objects.Legacy.Mania.ConvertHitObjectParser();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
/// <summary>
|
||||
/// Legacy osu!catch Hit-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Hit : HitObject, IHasCombo, IHasXPosition
|
||||
internal sealed class ConvertHit : HitObject, IHasCombo, IHasXPosition
|
||||
{
|
||||
public float X { get; set; }
|
||||
|
@ -11,11 +11,11 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
/// <summary>
|
||||
/// A HitObjectParser to parse legacy osu!catch Beatmaps.
|
||||
/// </summary>
|
||||
internal class HitObjectParser : Legacy.HitObjectParser
|
||||
internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
|
||||
{
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo)
|
||||
{
|
||||
return new Hit
|
||||
return new ConvertHit
|
||||
{
|
||||
X = position.X,
|
||||
NewCombo = newCombo,
|
||||
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
return new Slider
|
||||
return new ConvertSlider
|
||||
{
|
||||
X = position.X,
|
||||
NewCombo = newCombo,
|
||||
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
|
||||
protected override HitObject CreateSpinner(Vector2 position, double endTime)
|
||||
{
|
||||
return new Spinner
|
||||
return new ConvertSpinner
|
||||
{
|
||||
EndTime = endTime
|
||||
};
|
@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
/// <summary>
|
||||
/// Legacy osu!catch Slider-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Slider : LegacySlider, IHasXPosition, IHasCombo
|
||||
internal sealed class ConvertSlider : Legacy.ConvertSlider, IHasXPosition, IHasCombo
|
||||
{
|
||||
public float X { get; set; }
|
||||
|
@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Catch
|
||||
/// <summary>
|
||||
/// Legacy osu!catch Spinner-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Spinner : HitObject, IHasEndTime
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
@ -14,28 +14,28 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
/// <summary>
|
||||
/// A HitObjectParser to parse legacy Beatmaps.
|
||||
/// </summary>
|
||||
internal abstract class HitObjectParser : Objects.HitObjectParser
|
||||
internal abstract class ConvertHitObjectParser : Objects.HitObjectParser
|
||||
{
|
||||
public override HitObject Parse(string text)
|
||||
{
|
||||
string[] split = text.Split(',');
|
||||
HitObjectType type = (HitObjectType)int.Parse(split[3]) & ~HitObjectType.ColourHax;
|
||||
bool combo = type.HasFlag(HitObjectType.NewCombo);
|
||||
type &= ~HitObjectType.NewCombo;
|
||||
ConvertHitObjectType type = (ConvertHitObjectType)int.Parse(split[3]) & ~ConvertHitObjectType.ColourHax;
|
||||
bool combo = type.HasFlag(ConvertHitObjectType.NewCombo);
|
||||
type &= ~ConvertHitObjectType.NewCombo;
|
||||
|
||||
var soundType = (LegacySoundType)int.Parse(split[4]);
|
||||
var bankInfo = new SampleBankInfo();
|
||||
|
||||
HitObject result;
|
||||
|
||||
if ((type & HitObjectType.Circle) > 0)
|
||||
if ((type & ConvertHitObjectType.Circle) > 0)
|
||||
{
|
||||
result = CreateHit(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo);
|
||||
|
||||
if (split.Length > 5)
|
||||
readCustomSampleBanks(split[5], bankInfo);
|
||||
}
|
||||
else if ((type & HitObjectType.Slider) > 0)
|
||||
else if ((type & ConvertHitObjectType.Slider) > 0)
|
||||
{
|
||||
CurveType curveType = CurveType.Catmull;
|
||||
double length = 0;
|
||||
@ -129,21 +129,21 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
|
||||
result = CreateSlider(new Vector2(int.Parse(split[0]), int.Parse(split[1])), combo, points, length, curveType, repeatCount, nodeSamples);
|
||||
}
|
||||
else if ((type & HitObjectType.Spinner) > 0)
|
||||
else if ((type & ConvertHitObjectType.Spinner) > 0)
|
||||
{
|
||||
result = CreateSpinner(new Vector2(512, 384) / 2, Convert.ToDouble(split[5], CultureInfo.InvariantCulture));
|
||||
|
||||
if (split.Length > 6)
|
||||
readCustomSampleBanks(split[6], bankInfo);
|
||||
}
|
||||
else if ((type & HitObjectType.Hold) > 0)
|
||||
else if ((type & ConvertHitObjectType.Hold) > 0)
|
||||
{
|
||||
// Note: Hold is generated by BMS converts
|
||||
|
||||
// Todo: Apparently end time is determined by samples??
|
||||
// Shouldn't need implementation until mania
|
||||
|
||||
result = new Hold
|
||||
result = new ConvertHold
|
||||
{
|
||||
Position = new Vector2(int.Parse(split[0]), int.Parse(split[1])),
|
||||
NewCombo = combo
|
@ -6,7 +6,7 @@ using System;
|
||||
namespace osu.Game.Rulesets.Objects.Legacy
|
||||
{
|
||||
[Flags]
|
||||
public enum HitObjectType
|
||||
internal enum ConvertHitObjectType
|
||||
{
|
||||
Circle = 1 << 0,
|
||||
Slider = 1 << 1,
|
@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Objects.Legacy
|
||||
/// <summary>
|
||||
/// Legacy Hold-type, used for parsing "specials" in beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Hold : HitObject, IHasPosition, IHasCombo, IHasHold
|
||||
internal sealed class ConvertHold : HitObject, IHasPosition, IHasCombo, IHasHold
|
||||
{
|
||||
public Vector2 Position { get; set; }
|
||||
|
@ -9,7 +9,7 @@ using osu.Game.Audio;
|
||||
|
||||
namespace osu.Game.Rulesets.Objects.Legacy
|
||||
{
|
||||
internal class LegacySlider : HitObject, IHasCurve
|
||||
internal abstract class ConvertSlider : HitObject, IHasCurve
|
||||
{
|
||||
public List<Vector2> ControlPoints { get; set; }
|
||||
public CurveType CurveType { get; set; }
|
@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
/// <summary>
|
||||
/// Legacy osu!mania Hit-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Hit : HitObject, IHasXPosition, IHasCombo
|
||||
internal sealed class ConvertHit : HitObject, IHasXPosition, IHasCombo
|
||||
{
|
||||
public float X { get; set; }
|
||||
|
@ -11,11 +11,11 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
/// <summary>
|
||||
/// A HitObjectParser to parse legacy osu!mania Beatmaps.
|
||||
/// </summary>
|
||||
internal class HitObjectParser : Legacy.HitObjectParser
|
||||
internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
|
||||
{
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo)
|
||||
{
|
||||
return new Hit
|
||||
return new ConvertHit
|
||||
{
|
||||
X = position.X,
|
||||
NewCombo = newCombo,
|
||||
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
return new Slider
|
||||
return new ConvertSlider
|
||||
{
|
||||
X = position.X,
|
||||
NewCombo = newCombo,
|
||||
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
|
||||
protected override HitObject CreateSpinner(Vector2 position, double endTime)
|
||||
{
|
||||
return new Spinner
|
||||
return new ConvertSpinner
|
||||
{
|
||||
X = position.X,
|
||||
EndTime = endTime
|
@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
/// <summary>
|
||||
/// Legacy osu!mania Slider-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Slider : LegacySlider, IHasXPosition, IHasCombo
|
||||
internal sealed class ConvertSlider : Legacy.ConvertSlider, IHasXPosition, IHasCombo
|
||||
{
|
||||
public float X { get; set; }
|
||||
|
@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Mania
|
||||
/// <summary>
|
||||
/// Legacy osu!mania Spinner-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Spinner : HitObject, IHasEndTime, IHasXPosition
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime, IHasXPosition
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
/// <summary>
|
||||
/// Legacy osu! Hit-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Hit : HitObject, IHasPosition, IHasCombo
|
||||
internal sealed class ConvertHit : HitObject, IHasPosition, IHasCombo
|
||||
{
|
||||
public Vector2 Position { get; set; }
|
||||
|
@ -11,11 +11,11 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
/// <summary>
|
||||
/// A HitObjectParser to parse legacy osu! Beatmaps.
|
||||
/// </summary>
|
||||
internal class HitObjectParser : Legacy.HitObjectParser
|
||||
internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
|
||||
{
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo)
|
||||
{
|
||||
return new Hit
|
||||
return new ConvertHit
|
||||
{
|
||||
Position = position,
|
||||
NewCombo = newCombo,
|
||||
@ -24,7 +24,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
return new Slider
|
||||
return new ConvertSlider
|
||||
{
|
||||
Position = position,
|
||||
NewCombo = newCombo,
|
||||
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
|
||||
protected override HitObject CreateSpinner(Vector2 position, double endTime)
|
||||
{
|
||||
return new Spinner
|
||||
return new ConvertSpinner
|
||||
{
|
||||
Position = position,
|
||||
EndTime = endTime
|
@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
/// <summary>
|
||||
/// Legacy osu! Slider-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Slider : LegacySlider, IHasPosition, IHasCombo
|
||||
internal sealed class ConvertSlider : Legacy.ConvertSlider, IHasPosition, IHasCombo
|
||||
{
|
||||
public Vector2 Position { get; set; }
|
||||
|
@ -9,7 +9,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Osu
|
||||
/// <summary>
|
||||
/// Legacy osu! Spinner-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Spinner : HitObject, IHasEndTime, IHasPosition
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime, IHasPosition
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
/// <summary>
|
||||
/// Legacy osu!taiko Hit-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Hit : HitObject, IHasCombo
|
||||
internal sealed class ConvertHit : HitObject, IHasCombo
|
||||
{
|
||||
public bool NewCombo { get; set; }
|
||||
}
|
@ -11,11 +11,11 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
/// <summary>
|
||||
/// A HitObjectParser to parse legacy osu!taiko Beatmaps.
|
||||
/// </summary>
|
||||
internal class HitObjectParser : Legacy.HitObjectParser
|
||||
internal class ConvertHitObjectParser : Legacy.ConvertHitObjectParser
|
||||
{
|
||||
protected override HitObject CreateHit(Vector2 position, bool newCombo)
|
||||
{
|
||||
return new Hit
|
||||
return new ConvertHit
|
||||
{
|
||||
NewCombo = newCombo,
|
||||
};
|
||||
@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
|
||||
protected override HitObject CreateSlider(Vector2 position, bool newCombo, List<Vector2> controlPoints, double length, CurveType curveType, int repeatCount, List<List<SampleInfo>> repeatSamples)
|
||||
{
|
||||
return new Slider
|
||||
return new ConvertSlider
|
||||
{
|
||||
NewCombo = newCombo,
|
||||
ControlPoints = controlPoints,
|
||||
@ -36,7 +36,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
|
||||
protected override HitObject CreateSpinner(Vector2 position, double endTime)
|
||||
{
|
||||
return new Spinner
|
||||
return new ConvertSpinner
|
||||
{
|
||||
EndTime = endTime
|
||||
};
|
@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
/// <summary>
|
||||
/// Legacy osu!taiko Slider-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Slider : LegacySlider, IHasCombo
|
||||
internal sealed class ConvertSlider : Legacy.ConvertSlider, IHasCombo
|
||||
{
|
||||
public bool NewCombo { get; set; }
|
||||
}
|
@ -8,7 +8,7 @@ namespace osu.Game.Rulesets.Objects.Legacy.Taiko
|
||||
/// <summary>
|
||||
/// Legacy osu!taiko Spinner-type, used for parsing Beatmaps.
|
||||
/// </summary>
|
||||
internal sealed class Spinner : HitObject, IHasEndTime
|
||||
internal sealed class ConvertSpinner : HitObject, IHasEndTime
|
||||
{
|
||||
public double EndTime { get; set; }
|
||||
|
@ -109,20 +109,20 @@
|
||||
<Compile Include="IO\Serialization\IJsonSerializable.cs" />
|
||||
<Compile Include="IPC\ScoreIPCChannel.cs" />
|
||||
<Compile Include="Rulesets\BeatmapStatistic.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Catch\Hit.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Catch\HitObjectParser.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Catch\Slider.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Catch\Spinner.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\LegacySlider.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Mania\Hit.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Mania\HitObjectParser.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Mania\Slider.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Mania\Spinner.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Osu\HitObjectParser.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Taiko\Hit.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Taiko\HitObjectParser.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Taiko\Slider.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Taiko\Spinner.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Catch\ConvertHit.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Catch\ConvertHitObjectParser.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Catch\ConvertSlider.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Catch\ConvertSpinner.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\ConvertSlider.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Mania\ConvertHit.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Mania\ConvertHitObjectParser.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Mania\ConvertSlider.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Mania\ConvertSpinner.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Osu\ConvertHitObjectParser.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Taiko\ConvertHit.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Taiko\ConvertHitObjectParser.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Taiko\ConvertSlider.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Taiko\ConvertSpinner.cs" />
|
||||
<Compile Include="Rulesets\Objects\Types\IHasXPosition.cs" />
|
||||
<Compile Include="Rulesets\Objects\Types\IHasYPosition.cs" />
|
||||
<Compile Include="Rulesets\Replays\Replay.cs" />
|
||||
@ -135,11 +135,11 @@
|
||||
<Compile Include="Rulesets\Objects\Drawables\HitResult.cs" />
|
||||
<Compile Include="Rulesets\Objects\BezierApproximator.cs" />
|
||||
<Compile Include="Rulesets\Objects\CircularArcApproximator.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Osu\Hit.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\HitObjectParser.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Hold.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Osu\Slider.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Osu\Spinner.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Osu\ConvertHit.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\ConvertHitObjectParser.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\ConvertHold.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Osu\ConvertSlider.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\Osu\ConvertSpinner.cs" />
|
||||
<Compile Include="Rulesets\Objects\SliderCurve.cs" />
|
||||
<Compile Include="Rulesets\Objects\Types\CurveType.cs" />
|
||||
<Compile Include="Rulesets\Objects\Drawables\IDrawableHitObjectWithProxiedApproach.cs" />
|
||||
@ -152,7 +152,7 @@
|
||||
<Compile Include="Rulesets\Objects\Types\IHasRepeats.cs" />
|
||||
<Compile Include="Rulesets\Objects\Types\IHasPosition.cs" />
|
||||
<Compile Include="Rulesets\Objects\Types\IHasHold.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\HitObjectType.cs" />
|
||||
<Compile Include="Rulesets\Objects\Legacy\ConvertHitObjectType.cs" />
|
||||
<Compile Include="Rulesets\Replays\ReplayButtonState.cs" />
|
||||
<Compile Include="Rulesets\Replays\ReplayFrame.cs" />
|
||||
<Compile Include="Database\RulesetDatabase.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user