Fixed code style

This commit is contained in:
Christine Chen 2021-04-08 20:28:23 -04:00
parent 6bccb3aab6
commit 493c095535
8 changed files with 14 additions and 8 deletions

View File

@ -21,7 +21,7 @@ namespace osu.Android
: base(null) : base(null)
{ {
gameActivity = activity; gameActivity = activity;
powerStatus = new AndroidPowerStatus(); PowerStatus = new AndroidPowerStatus();
} }
public override Version AssemblyVersion public override Version AssemblyVersion

View File

@ -22,7 +22,6 @@ using osu.Desktop.Windows;
using osu.Framework.Threading; using osu.Framework.Threading;
using osu.Game.IO; using osu.Game.IO;
using osu.Game.Utils; using osu.Game.Utils;
using osu.Framework.Allocation;
namespace osu.Desktop namespace osu.Desktop
{ {
@ -35,7 +34,7 @@ namespace osu.Desktop
: base(args) : base(args)
{ {
noVersionOverlay = args?.Any(a => a == "--no-version-overlay") ?? false; noVersionOverlay = args?.Any(a => a == "--no-version-overlay") ?? false;
powerStatus = new DefaultPowerStatus(); PowerStatus = new DefaultPowerStatus();
} }
public override StableStorage GetStorageForStableInstall() public override StableStorage GetStorageForStableInstall()

View File

@ -300,7 +300,11 @@ namespace osu.Game.Tests.Visual.Gameplay
AddStep("reset notification lock", () => sessionStatics.GetBindable<bool>(Static.BatteryLowNotificationShownOnce).Value = false); AddStep("reset notification lock", () => sessionStatics.GetBindable<bool>(Static.BatteryLowNotificationShownOnce).Value = false);
// set charge status and level // set charge status and level
AddStep("load player", () => resetPlayer(false, () => { powerStatus.IsCharging = isCharging; powerStatus.ChargeLevel = chargeLevel; })); AddStep("load player", () => resetPlayer(false, () =>
{
powerStatus.IsCharging = isCharging;
powerStatus.ChargeLevel = chargeLevel;
}));
AddUntilStep("wait for player", () => player?.LoadState == LoadState.Ready); AddUntilStep("wait for player", () => player?.LoadState == LoadState.Ready);
int notificationCount = !isCharging && chargeLevel <= powerStatus.BatteryCutoff ? 1 : 0; int notificationCount = !isCharging && chargeLevel <= powerStatus.BatteryCutoff ? 1 : 0;
AddAssert("check for notification", () => notificationOverlay.UnreadCount.Value == notificationCount); AddAssert("check for notification", () => notificationOverlay.UnreadCount.Value == notificationCount);

View File

@ -96,7 +96,7 @@ namespace osu.Game
protected Storage Storage { get; set; } protected Storage Storage { get; set; }
protected PowerStatus powerStatus; protected PowerStatus PowerStatus;
[Cached] [Cached]
[Cached(typeof(IBindable<RulesetInfo>))] [Cached(typeof(IBindable<RulesetInfo>))]
@ -333,7 +333,7 @@ namespace osu.Game
Ruleset.BindValueChanged(onRulesetChanged); Ruleset.BindValueChanged(onRulesetChanged);
dependencies.CacheAs(powerStatus); dependencies.CacheAs(PowerStatus);
} }
private void onRulesetChanged(ValueChangedEvent<RulesetInfo> r) private void onRulesetChanged(ValueChangedEvent<RulesetInfo> r)

View File

@ -477,6 +477,7 @@ namespace osu.Game.Screens.Play
#endregion #endregion
#region Low battery warning #region Low battery warning
private Bindable<bool> batteryWarningShownOnce; private Bindable<bool> batteryWarningShownOnce;
private void showBatteryWarningIfNeeded() private void showBatteryWarningIfNeeded()

View File

@ -15,8 +15,9 @@ namespace osu.Game.Tests
{ {
public OsuTestBrowser() public OsuTestBrowser()
{ {
powerStatus = new DefaultPowerStatus(); PowerStatus = new DefaultPowerStatus();
} }
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();

View File

@ -10,6 +10,7 @@ namespace osu.Game.Utils
/// is sent. /// is sent.
/// </summary> /// </summary>
public virtual double BatteryCutoff { get; } = 0.2; public virtual double BatteryCutoff { get; } = 0.2;
public virtual double ChargeLevel { get; set; } public virtual double ChargeLevel { get; set; }
public virtual bool IsCharging { get; set; } public virtual bool IsCharging { get; set; }
} }

View File

@ -15,7 +15,7 @@ namespace osu.iOS
public OsuGameIOS() public OsuGameIOS()
: base(null) : base(null)
{ {
powerStatus = new IOSPowerStatus(); PowerStatus = new IOSPowerStatus();
} }
public override Version AssemblyVersion => new Version(NSBundle.MainBundle.InfoDictionary["CFBundleVersion"].ToString()); public override Version AssemblyVersion => new Version(NSBundle.MainBundle.InfoDictionary["CFBundleVersion"].ToString());