mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 19:23:21 +08:00
Review changes
This commit is contained in:
parent
3454ec1ca3
commit
9b36cf2066
@ -30,21 +30,20 @@ namespace osu.Game.Rulesets.Catch
|
|||||||
new KeyBinding(InputKey.Shift, CatchAction.Dash),
|
new KeyBinding(InputKey.Shift, CatchAction.Dash),
|
||||||
};
|
};
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetLegacyModsFor(LegacyMods mods)
|
public override IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods)
|
||||||
{
|
{
|
||||||
if (mods.HasFlag(LegacyMods.NightCore))
|
if (mods.HasFlag(LegacyMods.Nightcore))
|
||||||
yield return new CatchModNightcore();
|
yield return new CatchModNightcore();
|
||||||
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
||||||
yield return new CatchModDoubleTime();
|
yield return new CatchModDoubleTime();
|
||||||
|
|
||||||
|
if (mods.HasFlag(LegacyMods.Autoplay))
|
||||||
if (mods.HasFlag(LegacyMods.AutoPlay))
|
|
||||||
yield return new CatchModAutoplay();
|
yield return new CatchModAutoplay();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Easy))
|
if (mods.HasFlag(LegacyMods.Easy))
|
||||||
yield return new CatchModEasy();
|
yield return new CatchModEasy();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.FlashLight))
|
if (mods.HasFlag(LegacyMods.Flashlight))
|
||||||
yield return new CatchModFlashlight();
|
yield return new CatchModFlashlight();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HalfTime))
|
if (mods.HasFlag(LegacyMods.HalfTime))
|
||||||
|
@ -22,14 +22,14 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
{
|
{
|
||||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new ManiaRulesetContainer(this, beatmap, isForCurrentRuleset);
|
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset) => new ManiaRulesetContainer(this, beatmap, isForCurrentRuleset);
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetLegacyModsFor(LegacyMods mods)
|
public override IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods)
|
||||||
{
|
{
|
||||||
if (mods.HasFlag(LegacyMods.NightCore))
|
if (mods.HasFlag(LegacyMods.Nightcore))
|
||||||
yield return new ManiaModNightcore();
|
yield return new ManiaModNightcore();
|
||||||
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
||||||
yield return new ManiaModDoubleTime();
|
yield return new ManiaModDoubleTime();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.AutoPlay))
|
if (mods.HasFlag(LegacyMods.Autoplay))
|
||||||
yield return new ManiaModAutoplay();
|
yield return new ManiaModAutoplay();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Easy))
|
if (mods.HasFlag(LegacyMods.Easy))
|
||||||
@ -38,7 +38,7 @@ namespace osu.Game.Rulesets.Mania
|
|||||||
if (mods.HasFlag(LegacyMods.FadeIn))
|
if (mods.HasFlag(LegacyMods.FadeIn))
|
||||||
yield return new ManiaModFadeIn();
|
yield return new ManiaModFadeIn();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.FlashLight))
|
if (mods.HasFlag(LegacyMods.Flashlight))
|
||||||
yield return new ManiaModFlashlight();
|
yield return new ManiaModFlashlight();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HalfTime))
|
if (mods.HasFlag(LegacyMods.HalfTime))
|
||||||
|
@ -67,24 +67,23 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetLegacyModsFor(LegacyMods mods)
|
public override IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods)
|
||||||
{
|
{
|
||||||
if (mods.HasFlag(LegacyMods.NightCore))
|
if (mods.HasFlag(LegacyMods.Nightcore))
|
||||||
yield return new OsuModNightcore();
|
yield return new OsuModNightcore();
|
||||||
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
||||||
yield return new OsuModDoubleTime();
|
yield return new OsuModDoubleTime();
|
||||||
|
|
||||||
|
if (mods.HasFlag(LegacyMods.Autopilot))
|
||||||
if (mods.HasFlag(LegacyMods.AutoPilot))
|
|
||||||
yield return new OsuModAutopilot();
|
yield return new OsuModAutopilot();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.AutoPlay))
|
if (mods.HasFlag(LegacyMods.Autoplay))
|
||||||
yield return new OsuModAutoplay();
|
yield return new OsuModAutoplay();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Easy))
|
if (mods.HasFlag(LegacyMods.Easy))
|
||||||
yield return new OsuModEasy();
|
yield return new OsuModEasy();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.FlashLight))
|
if (mods.HasFlag(LegacyMods.Flashlight))
|
||||||
yield return new OsuModFlashlight();
|
yield return new OsuModFlashlight();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HalfTime))
|
if (mods.HasFlag(LegacyMods.HalfTime))
|
||||||
@ -111,7 +110,7 @@ namespace osu.Game.Rulesets.Osu
|
|||||||
if (mods.HasFlag(LegacyMods.SuddenDeath))
|
if (mods.HasFlag(LegacyMods.SuddenDeath))
|
||||||
yield return new OsuModSuddenDeath();
|
yield return new OsuModSuddenDeath();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.TargetPractice))
|
if (mods.HasFlag(LegacyMods.Target))
|
||||||
yield return new OsuModTarget();
|
yield return new OsuModTarget();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,21 +32,20 @@ namespace osu.Game.Rulesets.Taiko
|
|||||||
new KeyBinding(InputKey.MouseRight, TaikoAction.RightRim),
|
new KeyBinding(InputKey.MouseRight, TaikoAction.RightRim),
|
||||||
};
|
};
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetLegacyModsFor(LegacyMods mods)
|
public override IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods)
|
||||||
{
|
{
|
||||||
if (mods.HasFlag(LegacyMods.NightCore))
|
if (mods.HasFlag(LegacyMods.Nightcore))
|
||||||
yield return new TaikoModNightcore();
|
yield return new TaikoModNightcore();
|
||||||
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
else if (mods.HasFlag(LegacyMods.DoubleTime))
|
||||||
yield return new TaikoModDoubleTime();
|
yield return new TaikoModDoubleTime();
|
||||||
|
|
||||||
|
if (mods.HasFlag(LegacyMods.Autoplay))
|
||||||
if (mods.HasFlag(LegacyMods.AutoPlay))
|
|
||||||
yield return new TaikoModAutoplay();
|
yield return new TaikoModAutoplay();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.Easy))
|
if (mods.HasFlag(LegacyMods.Easy))
|
||||||
yield return new TaikoModEasy();
|
yield return new TaikoModEasy();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.FlashLight))
|
if (mods.HasFlag(LegacyMods.Flashlight))
|
||||||
yield return new TaikoModFlashlight();
|
yield return new TaikoModFlashlight();
|
||||||
|
|
||||||
if (mods.HasFlag(LegacyMods.HalfTime))
|
if (mods.HasFlag(LegacyMods.HalfTime))
|
||||||
|
@ -54,8 +54,6 @@ namespace osu.Game.Beatmaps
|
|||||||
{
|
{
|
||||||
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { };
|
public override IEnumerable<Mod> GetModsFor(ModType type) => new Mod[] { };
|
||||||
|
|
||||||
public override IEnumerable<Mod> GetLegacyModsFor(LegacyMods mods) => new Mod[] { };
|
|
||||||
|
|
||||||
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
public override RulesetContainer CreateRulesetContainerWith(WorkingBeatmap beatmap, bool isForCurrentRuleset)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
|
@ -9,35 +9,34 @@ namespace osu.Game.Beatmaps.Legacy
|
|||||||
public enum LegacyMods
|
public enum LegacyMods
|
||||||
{
|
{
|
||||||
None = 0,
|
None = 0,
|
||||||
NoFail = 1,
|
NoFail = 1 << 0,
|
||||||
Easy = 2,
|
Easy = 1 << 1,
|
||||||
TouchDevice = 4,
|
TouchDevice = 1 << 2,
|
||||||
Hidden = 8,
|
Hidden = 1 << 3,
|
||||||
HardRock = 16,
|
HardRock = 1 << 4,
|
||||||
SuddenDeath = 32,
|
SuddenDeath = 1 << 5,
|
||||||
DoubleTime = 64,
|
DoubleTime = 1 << 6,
|
||||||
Relax = 128,
|
Relax = 1 << 7,
|
||||||
HalfTime = 256,
|
HalfTime = 1 << 8,
|
||||||
NightCore = 512,
|
Nightcore = 1 << 9,
|
||||||
FlashLight = 1024,
|
Flashlight = 1 << 10,
|
||||||
AutoPlay = 2048,
|
Autoplay = 1 << 11,
|
||||||
SpunOut = 4096,
|
SpunOut = 1 << 12,
|
||||||
AutoPilot = 8192,
|
Autopilot = 1 << 13,
|
||||||
Perfect = 16384,
|
Perfect = 1 << 14,
|
||||||
Key4 = 32768,
|
Key4 = 1 << 15,
|
||||||
Key5 = 65536,
|
Key5 = 1 << 16,
|
||||||
Key6 = 131072,
|
Key6 = 1 << 17,
|
||||||
Key7 = 262144,
|
Key7 = 1 << 18,
|
||||||
Key8 = 524288,
|
Key8 = 1 << 19,
|
||||||
keyMod = 1015808,// k4+k5+k6+k7+k8
|
FadeIn = 1 << 20,
|
||||||
FadeIn = 1048576,
|
Random = 1 << 21,
|
||||||
Random = 2097152,
|
Cinema = 1 << 22,
|
||||||
Cinema = 4194304,
|
Target = 1 << 23,
|
||||||
TargetPractice = 8388608,
|
Key9 = 1 << 24,
|
||||||
Key9 = 16777216,
|
KeyCoop = 1 << 25,
|
||||||
Coop = 33554432,
|
Key1 = 1 << 26,
|
||||||
Key1 = 67108864,
|
Key3 = 1 << 27,
|
||||||
Key3 = 134217728,
|
Key2 = 1 << 28,
|
||||||
Key2 = 268435456,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,12 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
public abstract IEnumerable<Mod> GetModsFor(ModType type);
|
||||||
|
|
||||||
public abstract IEnumerable<Mod> GetLegacyModsFor(LegacyMods mods);
|
/// <summary>
|
||||||
|
/// Converts mods from legacy enum values. Do not override if you're not a legacy ruleset.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="mods">The legacy enum which will be converted</param>
|
||||||
|
/// <returns>An enumerable of constructed <see cref="Mod"/>s</returns>
|
||||||
|
public virtual IEnumerable<Mod> ConvertLegacyMods(LegacyMods mods) => new Mod[] { };
|
||||||
|
|
||||||
public Mod GetAutoplayMod() => GetAllMods().First(mod => mod is ModAutoplay);
|
public Mod GetAutoplayMod() => GetAllMods().First(mod => mod is ModAutoplay);
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ namespace osu.Game.Rulesets.Scoring.Legacy
|
|||||||
/* score.Perfect = */
|
/* score.Perfect = */
|
||||||
sr.ReadBoolean();
|
sr.ReadBoolean();
|
||||||
/* score.EnabledMods = (Mods)*/
|
/* score.EnabledMods = (Mods)*/
|
||||||
score.Mods = currentRuleset.GetLegacyModsFor((LegacyMods)sr.ReadInt32()).ToArray();
|
score.Mods = currentRuleset.ConvertLegacyMods((LegacyMods)sr.ReadInt32()).ToArray();
|
||||||
/* score.HpGraphString = */
|
/* score.HpGraphString = */
|
||||||
sr.ReadString();
|
sr.ReadString();
|
||||||
/* score.Date = */
|
/* score.Date = */
|
||||||
|
Loading…
Reference in New Issue
Block a user