Create a nil value type for DisableDropSound. (#114)

This commit is contained in:
Glen M
2018-12-05 11:42:59 -05:00
committed by Ben Wallis
parent 892b2f15f2
commit 2415be089b
7 changed files with 49 additions and 21 deletions

View File

@@ -327,7 +327,7 @@ namespace Filtration.Parser.Services
// Only ever use the last DisableDropSound item encountered as multiples aren't valid.
RemoveExistingBlockItemsOfType<DisableDropSoundBlockItem>(block);
AddBooleanItemToBlockItems<DisableDropSoundBlockItem>(block, trimmedLine);
AddNilItemToBlockItems<DisableDropSoundBlockItem>(block, trimmedLine);
break;
}
case "MinimapIcon":
@@ -512,6 +512,13 @@ namespace Filtration.Parser.Services
}
}
private static void AddNilItemToBlockItems<T>(IItemFilterBlock block, string inputString) where T : NilBlockItem
{
var blockItem = Activator.CreateInstance<T>();
blockItem.Comment = GetTextAfterFirstComment(inputString);
block.BlockItems.Add(blockItem);
}
private static void AddNumericFilterPredicateItemToBlockItems<T>(IItemFilterBlock block, string inputString) where T : NumericFilterPredicateBlockItem
{
var blockItem = Activator.CreateInstance<T>();