Files
crystall-punk-14/Content.Shared/Silicons/Laws/Components/SiliconLawBoundComponent.cs
slarticodefast 321331e664 move all the radio components and system to Shared (#40293)
* move all the radio components and system to Shared.

* duh split impl

* address reviews

* cleanup

---------

Co-authored-by: walksanatora <walkerffo22@gmail.com>
2025-09-12 01:26:47 +02:00

63 lines
1.6 KiB
C#

using Content.Shared.Actions;
using Content.Shared.Radio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Silicons.Laws.Components;
/// <summary>
/// This is used for entities which are bound to silicon laws and can view them.
/// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedSiliconLawSystem))]
public sealed partial class SiliconLawBoundComponent : Component
{
/// <summary>
/// The last entity that provided laws to this entity.
/// </summary>
[DataField]
public EntityUid? LastLawProvider;
}
/// <summary>
/// Event raised to get the laws that a law-bound entity has.
///
/// Is first raised on the entity itself, then on the
/// entity's station, then on the entity's grid,
/// before being broadcast.
/// </summary>
/// <param name="Entity"></param>
[ByRefEvent]
public record struct GetSiliconLawsEvent(EntityUid Entity)
{
public EntityUid Entity = Entity;
public SiliconLawset Laws = new();
public bool Handled = false;
}
public sealed partial class ToggleLawsScreenEvent : InstantActionEvent
{
}
[NetSerializable, Serializable]
public enum SiliconLawsUiKey : byte
{
Key
}
[Serializable, NetSerializable]
public sealed class SiliconLawBuiState : BoundUserInterfaceState
{
public List<SiliconLaw> Laws;
public HashSet<ProtoId<RadioChannelPrototype>>? RadioChannels;
public SiliconLawBuiState(List<SiliconLaw> laws, HashSet<ProtoId<RadioChannelPrototype>>? radioChannels)
{
Laws = laws;
RadioChannels = radioChannels;
}
}