Merge pull request #10105 from smoogipoo/rollingcounter-currentvalue

Fix broken RollingCounter current value implementation
This commit is contained in:
Dean Herbert
2020-09-09 21:35:01 +09:00
committed by GitHub

View File

@ -9,16 +9,20 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics.UserInterface;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
{ {
public abstract class RollingCounter<T> : Container public abstract class RollingCounter<T> : Container, IHasCurrentValue<T>
where T : struct, IEquatable<T> where T : struct, IEquatable<T>
{ {
/// <summary> private readonly BindableWithCurrent<T> current = new BindableWithCurrent<T>();
/// The current value.
/// </summary> public Bindable<T> Current
public Bindable<T> Current = new Bindable<T>(); {
get => current.Current;
set => current.Current = value;
}
private SpriteText displayedCountSpriteText; private SpriteText displayedCountSpriteText;