ninja 2 electric boogaloo (#15534)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
@@ -156,5 +156,16 @@ namespace Content.Server.Power.EntitySystems
|
||||
UseCharge(uid, value, battery);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the battery is at least 99% charged, basically full.
|
||||
/// </summary>
|
||||
public bool IsFull(EntityUid uid, BatteryComponent? battery = null)
|
||||
{
|
||||
if (!Resolve(uid, ref battery))
|
||||
return false;
|
||||
|
||||
return battery.CurrentCharge / battery.MaxCharge >= 0.99f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user