mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 01:43:15 +08:00
Use generic IEqutable to avoid typeless Equals.
This commit is contained in:
parent
aaaee5ed10
commit
f1d5a92950
@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using OpenTK;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Audio;
|
||||
@ -13,7 +14,8 @@ using osu.Framework.Input;
|
||||
|
||||
namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public class OsuSliderBar<T> : SliderBar<T>, IHasTooltip where T : struct
|
||||
public class OsuSliderBar<T> : SliderBar<T>, IHasTooltip
|
||||
where T : struct, IEquatable<T>
|
||||
{
|
||||
private SampleChannel sample;
|
||||
private double lastSampleTime;
|
||||
|
@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
||||
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
||||
|
||||
using System;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.UserInterface;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
@ -8,12 +9,12 @@ using osu.Game.Graphics.UserInterface;
|
||||
namespace osu.Game.Overlays.Settings
|
||||
{
|
||||
public class SettingsSlider<T> : SettingsSlider<T, OsuSliderBar<T>>
|
||||
where T : struct
|
||||
where T : struct, IEquatable<T>
|
||||
{
|
||||
}
|
||||
|
||||
public class SettingsSlider<T, U> : SettingsItem<T>
|
||||
where T : struct
|
||||
where T : struct, IEquatable<T>
|
||||
where U : SliderBar<T>, new()
|
||||
{
|
||||
protected override Drawable CreateControl() => new U()
|
||||
|
Loading…
Reference in New Issue
Block a user