1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 06:47:24 +08:00

Remove class "ModRandomOsu" and adjust code

Add documentation comment for OsuModRandom
This commit is contained in:
Pasi4K5 2021-04-25 01:34:39 +02:00
parent 92f765b958
commit f33f1b2bed
2 changed files with 32 additions and 49 deletions

View File

@ -3,17 +3,47 @@
using System;
using System.Linq;
using osu.Framework.Bindables;
using osu.Game.Beatmaps;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Osu.Objects;
using osu.Game.Rulesets.Osu.UI;
using osuTK;
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();

View File

@ -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);
}
}