using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Sound.Components; /// /// Base sound emitter which defines most of the data fields. /// Accepts both single sounds and sound collections. /// public abstract partial class BaseEmitSoundComponent : Component { /// /// The to play. /// [DataField(required: true)] public SoundSpecifier? Sound; /// /// Play the sound at the position instead of parented to the source entity. /// Useful if the entity is deleted after. /// [DataField] public bool Positional; } /// /// Represents the state of . /// /// This is obviously very cursed, but since the BaseEmitSoundComponent is abstract, we cannot network it. /// AutoGenerateComponentState attribute won't work here, and since everything revolves around inheritance for some fucking reason, /// there's no better way of doing this. [Serializable, NetSerializable] public struct EmitSoundComponentState(SoundSpecifier? sound) : IComponentState { public SoundSpecifier? Sound { get; } = sound; }