mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-10 19:01:13 +03:00
* IoC source gen compatibility Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter. * Missed a spot
19 lines
550 B
C#
19 lines
550 B
C#
using Robust.Shared.Audio.Systems;
|
|
|
|
namespace Content.Shared.Audio.Jukebox;
|
|
|
|
public abstract partial class SharedJukeboxSystem : EntitySystem
|
|
{
|
|
[Dependency] protected SharedAudioSystem Audio = default!;
|
|
|
|
/// <summary>
|
|
/// Returns whether or not the given jukebox is currently playing a song.
|
|
/// </summary>
|
|
public bool IsPlaying(Entity<JukeboxComponent?> entity)
|
|
{
|
|
if (!Resolve(entity, ref entity.Comp))
|
|
return false;
|
|
|
|
return entity.Comp.AudioStream is { } audio && Audio.IsPlaying(audio);
|
|
}
|
|
}
|