Promote Sound

This commit is contained in:
Matt Nadareski
2020-09-02 12:51:21 -07:00
parent 7aa042f76d
commit 07cf2135ff
11 changed files with 251 additions and 105 deletions

View File

@@ -158,12 +158,6 @@ namespace SabreTools.Library.DatItems
[JsonProperty("displays", DefaultValueHandling = DefaultValueHandling.Ignore)]
public List<Display> Displays { get; set; } = null;
/// <summary>
/// List of associated sounds
/// </summary>
[JsonProperty("sounds", DefaultValueHandling = DefaultValueHandling.Ignore)]
public List<Sound> Sounds { get; set; } = null;
/// <summary>
/// List of associated conditions
/// </summary>
@@ -553,7 +547,6 @@ namespace SabreTools.Library.DatItems
SourceFile = this.SourceFile,
Runnable = this.Runnable,
Displays = this.Displays,
Sounds = this.Sounds,
Conditions = this.Conditions,
Inputs = this.Inputs,
Ports = this.Ports,
@@ -1039,34 +1032,6 @@ namespace SabreTools.Library.DatItems
#endregion
#region Sounds
// Machine_Sounds
if (filter.Machine_Sounds.MatchesNeutral(null, Sounds?.Any() ?? null) == false)
return false;
// Machine_Sound_Channels
if (Sounds?.Any() == true)
{
bool anyPositive = false;
bool anyNegative = false;
foreach (var sound in Sounds)
{
if (filter.Machine_Sound_Channels.MatchesPositiveSet(sound?.Channels) != false)
anyPositive = true;
if (filter.Machine_Sound_Channels.MatchesNegativeSet(sound?.Channels) == true)
anyNegative = true;
}
if (!anyPositive)
return false;
if (anyNegative)
return false;
}
#endregion
#region Conditions
// Machine_Conditions