2021-04-09 07:34:35 +08:00
|
|
|
// 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.
|
|
|
|
|
|
|
|
namespace osu.Game.Utils
|
|
|
|
{
|
2021-04-10 05:55:41 +08:00
|
|
|
/// <summary>
|
|
|
|
/// Provides access to the system's power status.
|
|
|
|
/// </summary>
|
2021-04-12 22:52:12 +08:00
|
|
|
public abstract class BatteryInfo
|
2021-04-09 07:34:35 +08:00
|
|
|
{
|
2021-04-10 05:55:41 +08:00
|
|
|
/// <summary>
|
2022-07-30 20:26:19 +08:00
|
|
|
/// The charge level of the battery, from <c>0</c> to <c>1</c>, or <c>null</c> if a battery isn't present.
|
2021-04-10 05:55:41 +08:00
|
|
|
/// </summary>
|
2022-07-30 20:26:19 +08:00
|
|
|
public abstract double? ChargeLevel { get; }
|
2021-04-09 07:34:35 +08:00
|
|
|
|
2022-07-30 20:26:19 +08:00
|
|
|
/// <summary>
|
|
|
|
/// Whether the current power source is the battery.
|
|
|
|
/// </summary>
|
|
|
|
/// <remarks>
|
|
|
|
/// This is <c>false</c> when the device is charging or doesn't have a battery.
|
|
|
|
/// </remarks>
|
|
|
|
public abstract bool OnBattery { get; }
|
2021-04-09 07:34:35 +08:00
|
|
|
}
|
|
|
|
}
|