Chip gets a promotion

This commit is contained in:
Matt Nadareski
2020-08-25 22:48:46 -07:00
parent 0fa843a587
commit 143668c56a
13 changed files with 457 additions and 218 deletions

View File

@@ -158,12 +158,6 @@ namespace SabreTools.Library.DatItems
[JsonProperty("devicereferences", DefaultValueHandling = DefaultValueHandling.Ignore)]
public List<ListXmlDeviceReference> DeviceReferences { get; set; } = null;
/// <summary>
/// List of associated chips
/// </summary>
[JsonProperty("chips", DefaultValueHandling = DefaultValueHandling.Ignore)]
public List<ListXmlChip> Chips { get; set; } = null;
/// <summary>
/// List of associated displays
/// </summary>
@@ -603,7 +597,6 @@ namespace SabreTools.Library.DatItems
SourceFile = this.SourceFile,
Runnable = this.Runnable,
DeviceReferences = this.DeviceReferences,
Chips = this.Chips,
Displays = this.Displays,
Sounds = this.Sounds,
Conditions = this.Conditions,
@@ -842,94 +835,6 @@ namespace SabreTools.Library.DatItems
#endregion
#region Chips
// Machine_DeviceReferences
if (filter.Machine_Chips.MatchesNeutral(null, Chips?.Any() ?? null) == false)
return false;
// Machine_Chip_Name
if (Chips?.Any() == true)
{
bool anyPositive = false;
bool anyNegative = false;
foreach (var chip in Chips)
{
if (filter.Machine_Chip_Name.MatchesPositiveSet(chip?.Name) != false)
anyPositive = true;
if (filter.Machine_Chip_Name.MatchesNegativeSet(chip?.Name) == true)
anyNegative = true;
}
if (!anyPositive)
return false;
if (anyNegative)
return false;
}
// Machine_Chip_Tag
if (Chips?.Any() == true)
{
bool anyPositive = false;
bool anyNegative = false;
foreach (var chip in Chips)
{
if (filter.Machine_Chip_Tag.MatchesPositiveSet(chip?.Tag) != false)
anyPositive = true;
if (filter.Machine_Chip_Tag.MatchesNegativeSet(chip?.Tag) == true)
anyNegative = true;
}
if (!anyPositive)
return false;
if (anyNegative)
return false;
}
// Machine_Chip_Type
if (Chips?.Any() == true)
{
bool anyPositive = false;
bool anyNegative = false;
foreach (var chip in Chips)
{
if (filter.Machine_Chip_Type.MatchesPositiveSet(chip?.Type) != false)
anyPositive = true;
if (filter.Machine_Chip_Type.MatchesNegativeSet(chip?.Type) == true)
anyNegative = true;
}
if (!anyPositive)
return false;
if (anyNegative)
return false;
}
// Machine_Chip_Clock
if (Chips?.Any() == true)
{
bool anyPositive = false;
bool anyNegative = false;
foreach (var chip in Chips)
{
if (filter.Machine_Chip_Clock.MatchesPositiveSet(chip?.Clock) != false)
anyPositive = true;
if (filter.Machine_Chip_Clock.MatchesNegativeSet(chip?.Clock) == true)
anyNegative = true;
}
if (!anyPositive)
return false;
if (anyNegative)
return false;
}
#endregion
#region Displays
// Machine_Displays