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>
29 lines
921 B
C#
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>();
|
|
}
|
|
}
|
|
}
|