mirror of
https://github.com/ppy/osu.git
synced 2024-11-11 20:07:29 +08:00
Remove class "ModRandomOsu" and adjust code
Add documentation comment for OsuModRandom
This commit is contained in:
parent
92f765b958
commit
f33f1b2bed
@ -3,17 +3,47 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using osu.Framework.Bindables;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
|
using osu.Game.Configuration;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Osu.Objects;
|
using osu.Game.Rulesets.Osu.Objects;
|
||||||
using osu.Game.Rulesets.Osu.UI;
|
using osu.Game.Rulesets.Osu.UI;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.Mods
|
namespace osu.Game.Rulesets.Osu.Mods
|
||||||
{
|
{
|
||||||
public class OsuModRandom : ModRandomOsu
|
/// <summary>
|
||||||
|
/// Mod that randomises the positions of the <see cref="HitObject"/>s
|
||||||
|
/// </summary>
|
||||||
|
public class OsuModRandom : ModRandom, IApplicableToBeatmap
|
||||||
{
|
{
|
||||||
protected override void RandomiseHitObjectPositions(IBeatmap beatmap)
|
public override string Description => "Practice your reaction time!";
|
||||||
|
public override bool Ranked => false;
|
||||||
|
|
||||||
|
[SettingSource("Circles", "Hit circles appear at random positions")]
|
||||||
|
public Bindable<bool> RandomiseCirclePositions { get; } = new BindableBool
|
||||||
|
{
|
||||||
|
Default = true,
|
||||||
|
Value = true,
|
||||||
|
};
|
||||||
|
|
||||||
|
[SettingSource("Sliders", "Sliders appear at random positions")]
|
||||||
|
public Bindable<bool> RandomiseSliderPositions { get; } = new BindableBool
|
||||||
|
{
|
||||||
|
Default = true,
|
||||||
|
Value = true,
|
||||||
|
};
|
||||||
|
|
||||||
|
[SettingSource("Spinners", "Spinners appear at random positions")]
|
||||||
|
public Bindable<bool> RandomiseSpinnerPositions { get; } = new BindableBool
|
||||||
|
{
|
||||||
|
Default = true,
|
||||||
|
Value = true,
|
||||||
|
};
|
||||||
|
|
||||||
|
public void ApplyToBeatmap(IBeatmap beatmap)
|
||||||
{
|
{
|
||||||
var rng = new Random();
|
var rng = new Random();
|
||||||
|
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
// 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 osu.Framework.Bindables;
|
|
||||||
using osu.Framework.Graphics.Sprites;
|
|
||||||
using osu.Game.Beatmaps;
|
|
||||||
using osu.Game.Configuration;
|
|
||||||
using osu.Game.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Mods
|
|
||||||
{
|
|
||||||
public abstract class ModRandomOsu : Mod, IApplicableToBeatmap
|
|
||||||
{
|
|
||||||
public override string Name => "Random";
|
|
||||||
public override string Acronym => "RD";
|
|
||||||
public override IconUsage? Icon => OsuIcon.Dice;
|
|
||||||
public override ModType Type => ModType.Conversion;
|
|
||||||
public override string Description => "Practice your reaction time!";
|
|
||||||
public override double ScoreMultiplier => 1;
|
|
||||||
public override bool Ranked => false;
|
|
||||||
|
|
||||||
[SettingSource("Circles", "Hit circles appear at random positions")]
|
|
||||||
public Bindable<bool> RandomiseCirclePositions { get; } = new BindableBool
|
|
||||||
{
|
|
||||||
Default = true,
|
|
||||||
Value = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
[SettingSource("Sliders", "Sliders appear at random positions")]
|
|
||||||
public Bindable<bool> RandomiseSliderPositions { get; } = new BindableBool
|
|
||||||
{
|
|
||||||
Default = true,
|
|
||||||
Value = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
[SettingSource("Spinners", "Spinners appear at random positions")]
|
|
||||||
public Bindable<bool> RandomiseSpinnerPositions { get; } = new BindableBool
|
|
||||||
{
|
|
||||||
Default = true,
|
|
||||||
Value = true,
|
|
||||||
};
|
|
||||||
|
|
||||||
public void ApplyToBeatmap(IBeatmap beatmap) => RandomiseHitObjectPositions(beatmap);
|
|
||||||
|
|
||||||
protected abstract void RandomiseHitObjectPositions(IBeatmap beatmap);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user