FIL-4 Completed refactoring of Sections to ItemFilterCommentBlocks

This commit is contained in:
Ben Wallis
2017-06-17 12:19:54 +01:00
parent 43c6149832
commit b65fad0679
32 changed files with 518 additions and 275 deletions

View File

@@ -85,7 +85,6 @@
<Compile Include="ItemFilterBlockGroup.cs" />
<Compile Include="ItemFilterScript.cs" />
<Compile Include="ItemFilterScriptSettings.cs" />
<Compile Include="ItemFilterSection.cs" />
<Compile Include="ItemSet.cs" />
<Compile Include="NumericFilterPredicate.cs" />
<Compile Include="PathOfExileNamedColors.cs" />

View File

@@ -37,13 +37,11 @@ namespace Filtration.ObjectModel
public interface IItemFilterCommentBlock : IItemFilterBlockBase
{
string Comment { get; set; }
bool IsSection { get; set; }
}
public class ItemFilterCommentBlock : ItemFilterBlockBase, IItemFilterCommentBlock
{
public string Comment { get; set; }
public bool IsSection { get; set; }
}
public class ItemFilterBlock : ItemFilterBlockBase, IItemFilterBlock

View File

@@ -81,15 +81,9 @@ namespace Filtration.ObjectModel
private bool BlockIsColorReplacementCandidate(ReplaceColorsParameterSet replaceColorsParameterSet, IItemFilterBlock block)
{
var textColorItem = block.HasBlockItemOfType<TextColorBlockItem>()
? block.BlockItems.OfType<TextColorBlockItem>().First()
: null;
var backgroundColorItem = block.HasBlockItemOfType<BackgroundColorBlockItem>()
? block.BlockItems.OfType<BackgroundColorBlockItem>().First()
: null;
var borderColorItem = block.HasBlockItemOfType<BorderColorBlockItem>()
? block.BlockItems.OfType<BorderColorBlockItem>().First()
: null;
var textColorItem = block.BlockItems.OfType<TextColorBlockItem>().FirstOrDefault();
var backgroundColorItem = block.BlockItems.OfType<BackgroundColorBlockItem>().FirstOrDefault();
var borderColorItem = block.BlockItems.OfType<BorderColorBlockItem>().FirstOrDefault();
// If we don't have all of the things we want to replace, then we aren't a candidate for replacing those things.
if ((textColorItem == null && replaceColorsParameterSet.ReplaceTextColor) ||

View File

@@ -1,6 +0,0 @@
namespace Filtration.ObjectModel
{
public class ItemFilterSection : ItemFilterBlock
{
}
}