Files
tbd-station-14/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/PowerCellChargerComponent.cs
chairbender b35333d366 Click Drag Functionality + Refactor Interaction Interfaces (#1125)
Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
Co-authored-by: ComicIronic <comicironic@gmail.com>
Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
2020-07-06 23:27:03 +02:00

29 lines
921 B
C#

using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces.GameObjects.Components.Interaction;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Server.GameObjects.Components.Power.Chargers
{
/// <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>();
}
}
}