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>
30 lines
1.0 KiB
C#
30 lines
1.0 KiB
C#
using Content.Server.GameObjects.Components.Weapon.Ranged.Barrels;
|
|
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 the battery in a <see cref="ServerBatteryBarrelComponent"/>.
|
|
/// </summary>
|
|
[RegisterComponent]
|
|
[ComponentReference(typeof(IActivate))]
|
|
[ComponentReference(typeof(BaseCharger))]
|
|
public sealed class WeaponCapacitorChargerComponent : BaseCharger
|
|
{
|
|
public override string Name => "WeaponCapacitorCharger";
|
|
|
|
protected override bool IsEntityCompatible(IEntity entity)
|
|
{
|
|
return entity.HasComponent<ServerBatteryBarrelComponent>();
|
|
}
|
|
|
|
protected override BatteryComponent GetBatteryFrom(IEntity entity)
|
|
{
|
|
return entity.GetComponent<ServerBatteryBarrelComponent>().PowerCell;
|
|
}
|
|
}
|
|
}
|