Files
OldThink/Content.Server/_Amour/Hole/HoleSystem.cs

50 lines
1.4 KiB
C#
Raw Normal View History

using Content.Server.Administration;
using Content.Server.Chemistry.Containers.EntitySystems;
2024-02-14 12:49:00 +03:00
using Content.Shared._Amour.Hole;
using Content.Shared.Administration;
2024-02-14 12:49:00 +03:00
using Robust.Server.Containers;
using Robust.Shared.Containers;
2024-02-18 13:23:05 +03:00
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
2024-02-14 12:49:00 +03:00
using Robust.Shared.Timing;
using Robust.Shared.Toolshed;
using Robust.Shared.Toolshed.TypeParsers;
2024-02-14 12:49:00 +03:00
namespace Content.Server._Amour.Hole;
public sealed partial class HoleSystem : SharedHoleSystem
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
public override void Initialize()
{
2024-02-14 23:27:46 +03:00
base.Initialize();
2024-02-14 12:49:00 +03:00
InitializeInventory();
2024-02-18 13:23:05 +03:00
SubscribeLocalEvent<HoleComponent,ComponentGetState>(OnGetState);
}
private void OnGetState(EntityUid uid, HoleComponent component,ref ComponentGetState args)
{
args.State = new HoleComponentState(component.Parent, component.IsExcited);
2024-02-14 12:49:00 +03:00
}
public override void Update(float frameTime)
{
UpdateSolution(frameTime);
}
}
[ToolshedCommand, AdminCommand(AdminFlags.Fun)]
internal sealed class AddHoleCommand : ToolshedCommand
{
[CommandImplementation]
public void AddHole(
[CommandInvocationContext] IInvocationContext ctx,
[PipedArgument] EntityUid target,
[CommandArgument] Prototype<EntityPrototype> prototype)
{
GetSys<HoleSystem>().AddHole(target,prototype.Value.ID);
}
}