removed TryGetSound + made some SoundSpecifier datafields required

This commit is contained in:
Galactic Chimp
2021-07-31 19:52:33 +02:00
parent 8ff703c338
commit 57016d14b4
114 changed files with 519 additions and 785 deletions

View File

@@ -3,7 +3,6 @@ using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Utility;
using System.Diagnostics.CodeAnalysis;
namespace Content.Shared.Sound
{
@@ -11,8 +10,6 @@ namespace Content.Shared.Sound
public abstract class SoundSpecifier
{
public abstract string GetSound();
public abstract bool TryGetSound([NotNullWhen(true)] out string? sound);
}
public sealed class SoundPathSpecifier : SoundSpecifier
@@ -40,12 +37,6 @@ namespace Content.Shared.Sound
{
return Path == null ? string.Empty : Path.ToString();
}
public override bool TryGetSound([NotNullWhen(true)] out string? sound)
{
sound = GetSound();
return !string.IsNullOrWhiteSpace(sound);
}
}
public sealed class SoundCollectionSpecifier : SoundSpecifier
@@ -68,11 +59,5 @@ namespace Content.Shared.Sound
{
return Collection == null ? string.Empty : AudioHelpers.GetRandomFileFromSoundCollection(Collection);
}
public override bool TryGetSound([NotNullWhen(true)] out string? sound)
{
sound = GetSound();
return !string.IsNullOrWhiteSpace(sound);
}
}
}