mirror of
https://github.com/osukey/osukey.git
synced 2025-05-01 19:57:25 +09:00
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
// 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 System;
|
|
using Foundation;
|
|
using osu.Game;
|
|
using osu.Game.Updater;
|
|
using osu.Game.Utils;
|
|
using Xamarin.Essentials;
|
|
|
|
namespace osu.iOS
|
|
{
|
|
public class OsuGameIOS : OsuGame
|
|
{
|
|
public OsuGameIOS()
|
|
: base(null)
|
|
{
|
|
PowerStatus = new IOSPowerStatus();
|
|
}
|
|
public override Version AssemblyVersion => new Version(NSBundle.MainBundle.InfoDictionary["CFBundleVersion"].ToString());
|
|
|
|
protected override UpdateManager CreateUpdateManager() => new SimpleUpdateManager();
|
|
|
|
public class IOSPowerStatus : PowerStatus
|
|
{
|
|
// The low battery alert appears at 20% on iOS
|
|
// https://github.com/ppy/osu/issues/12239
|
|
public override double BatteryCutoff => 0.25;
|
|
public override double ChargeLevel => Battery.ChargeLevel;
|
|
|
|
public override bool IsCharging => Battery.PowerSource != BatteryPowerSource.Battery;
|
|
}
|
|
}
|
|
}
|