Skip to content

Commit

Permalink
Switch to const action prototypes with validators
Browse files Browse the repository at this point in the history
  • Loading branch information
vaketola committed Feb 22, 2024
1 parent 7968e08 commit 8bb0c80
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;

using Robust.Shared.Prototypes;

namespace Content.Server.SimpleStation14.Species.Shadowkin.Systems;

Expand All @@ -32,6 +32,8 @@ public sealed class ShadowkinDarkSwapSystem : EntitySystem
[Dependency] private readonly MagicSystem _magic = default!;
[Dependency] private readonly NpcFactionSystem _factions = default!;

[ValidatePrototypeId<EntityPrototype>]
private const string ActionShadowkinDarkSwapId = "ActionShadowkinDarkSwap";

public override void Initialize()
{
Expand All @@ -50,7 +52,7 @@ public override void Initialize()
private void Startup(EntityUid uid, ShadowkinDarkSwapPowerComponent component, ComponentStartup args)
{
var componentActionShadowkinDarkSwap = component.ActionShadowkinDarkSwap;
_actions.AddAction(uid, ref componentActionShadowkinDarkSwap, "ActionShadowkinDarkSwap");
_actions.AddAction(uid, ref componentActionShadowkinDarkSwap, ActionShadowkinDarkSwapId);
}

private void Shutdown(EntityUid uid, ShadowkinDarkSwapPowerComponent component, ComponentShutdown args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ namespace Content.Server.SimpleStation14.Species.Shadowkin.Systems;
public sealed class ShadowkinRestSystem : EntitySystem
{
[Dependency] private readonly IEntityManager _entity = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly ShadowkinPowerSystem _power = default!;

[ValidatePrototypeId<EntityPrototype>]
private const string ActionShadowkinRestId = "ActionShadowkinRest";

public override void Initialize()
{
Expand All @@ -30,7 +31,7 @@ public override void Initialize()
private void OnStartup(EntityUid uid, ShadowkinRestPowerComponent component, ComponentStartup args)
{
var componentActionShadowkinRest = component.ActionShadowkinRest;
_actions.AddAction(uid, ref componentActionShadowkinRest, "ActionShadowkinRest");
_actions.AddAction(uid, ref componentActionShadowkinRest, ActionShadowkinRestId);
}

private void OnShutdown(EntityUid uid, ShadowkinRestPowerComponent component, ComponentShutdown args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ public sealed class ShadowkinTeleportSystem : EntitySystem
[Dependency] private readonly StaminaSystem _stamina = default!;
[Dependency] private readonly PullingSystem _pulling = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly MagicSystem _magic = default!;

[ValidatePrototypeId<EntityPrototype>]
private const string ActionShadowkinTeleportId = "ActionShadowkinTeleport";

public override void Initialize()
{
Expand All @@ -40,7 +41,7 @@ public override void Initialize()
private void Startup(EntityUid uid, ShadowkinTeleportPowerComponent component, ComponentStartup args)
{
var componentActionShadowkinTeleport = component.ActionShadowkinTeleport;
_actions.AddAction(uid, ref componentActionShadowkinTeleport, "ActionShadowkinTeleport");
_actions.AddAction(uid, ref componentActionShadowkinTeleport, ActionShadowkinTeleportId);
}

private void Shutdown(EntityUid uid, ShadowkinTeleportPowerComponent component, ComponentShutdown args)
Expand Down

0 comments on commit 8bb0c80

Please sign in to comment.