Changed block item output order (Issue #41)
This commit is contained in:
@@ -129,6 +129,16 @@ namespace Filtration.Parser.Services
|
||||
AddStringListItemToBlockItems<BaseTypeBlockItem>(block, trimmedLine);
|
||||
break;
|
||||
}
|
||||
case "Corrupted":
|
||||
{
|
||||
AddBooleanItemToBlockItems<CorruptedBlockItem>(block, trimmedLine);
|
||||
break;
|
||||
}
|
||||
case "Identified":
|
||||
{
|
||||
AddBooleanItemToBlockItems<IdentifiedBlockItem>(block, trimmedLine);
|
||||
break;
|
||||
}
|
||||
case "Sockets":
|
||||
{
|
||||
AddNumericFilterPredicateItemToBlockItems<SocketsBlockItem>(block, trimmedLine);
|
||||
@@ -240,6 +250,17 @@ namespace Filtration.Parser.Services
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddBooleanItemToBlockItems<T>(IItemFilterBlock block, string inputString) where T : BooleanBlockItem
|
||||
{
|
||||
var blockItem = Activator.CreateInstance<T>();
|
||||
var splitString = inputString.Split(' ');
|
||||
if (splitString.Length == 2)
|
||||
{
|
||||
blockItem.BooleanValue = splitString[1].Trim().ToLowerInvariant() == "true";
|
||||
block.BlockItems.Add(blockItem);
|
||||
}
|
||||
}
|
||||
|
||||
private static void AddNumericFilterPredicateItemToBlockItems<T>(IItemFilterBlock block, string inputString) where T : NumericFilterPredicateBlockItem
|
||||
{
|
||||
var blockItem = Activator.CreateInstance<T>();
|
||||
|
||||
Reference in New Issue
Block a user