fish-station/Content.Shared/_Starlight/Action/StarlightActionsSystem.cs
Vigers Ray b52f640b5a
Порт стрельбы со старлайна (#2640)
Co-authored-by: KaiserMaus <kaiser.ratte@gmail.com>
2025-08-08 22:25:02 +03:00

30 lines
868 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Content.Shared.Actions.Components;
namespace Content.Shared._Starlight.Action;
public sealed class StarlightActionsSystem : EntitySystem
{
public EntityUid[] HideActions(EntityUid performer, ActionsComponent? comp = null)
{
if (!Resolve(performer, ref comp, false))
return [];
var actions = comp.Actions.ToArray();
comp.Actions.Clear();
Dirty(performer, comp);
return actions;
}
public void UnHideActions(EntityUid performer, EntityUid[] actions, ActionsComponent? comp = null)
{
if (!Resolve(performer, ref comp, false))
return;
foreach (var action in actions)
comp.Actions.Add(action);
Dirty(performer, comp);
}
}