2020-07-18 22:51:56 -07:00
|
|
|
|
using Content.Shared.Interfaces.GameObjects.Components;
|
2020-06-28 09:23:26 -06:00
|
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
|
using Robust.Shared.Interfaces.GameObjects;
|
|
|
|
|
|
|
2020-08-13 14:40:27 +02:00
|
|
|
|
namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerReceiverUsers
|
2020-06-28 09:23:26 -06:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Recharges an entity with a <see cref="BatteryComponent"/>.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[RegisterComponent]
|
|
|
|
|
|
[ComponentReference(typeof(IActivate))]
|
|
|
|
|
|
[ComponentReference(typeof(BaseCharger))]
|
|
|
|
|
|
public sealed class PowerCellChargerComponent : BaseCharger
|
|
|
|
|
|
{
|
|
|
|
|
|
public override string Name => "PowerCellCharger";
|
|
|
|
|
|
|
|
|
|
|
|
protected override bool IsEntityCompatible(IEntity entity)
|
|
|
|
|
|
{
|
|
|
|
|
|
return entity.HasComponent<BatteryComponent>();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override BatteryComponent GetBatteryFrom(IEntity entity)
|
|
|
|
|
|
{
|
|
|
|
|
|
return entity.GetComponent<BatteryComponent>();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|