Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for unidentified and corrupted items #1063

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Procurement/Procurement.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
<Compile Include="ViewModel\Filters\ForumExport\FullBestiaryOrbFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\GearSearchFilters.cs" />
<Compile Include="ViewModel\Filters\ForumExport\GemLevelFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\IdentifiedItemFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\IncreasedDamageFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\IncursionVialsFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\LeagestoneFilter.cs" />
Expand All @@ -214,6 +215,9 @@
<Compile Include="ViewModel\Filters\ForumExport\SixLink.cs" />
<Compile Include="ViewModel\Filters\ForumExport\SixRedSockets.cs" />
<Compile Include="ViewModel\Filters\ForumExport\SocketColourFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\CorruptedItemFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\UncorruptedItemFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\UnidentifiedItemFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\UnknownItemFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\ScarabFilter.cs" />
<Compile Include="ViewModel\Filters\ForumExport\VeiledModFilter.cs" />
Expand Down
44 changes: 44 additions & 0 deletions Procurement/ViewModel/Filters/ForumExport/CorruptedItemFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using POEApi.Model;

namespace Procurement.ViewModel.Filters.ForumExport
{
public class CorruptedItemFilter : IFilter
{
public bool CanFormCategory
{
get
{
return false;
}
}

public string Keyword
{
get
{
return "Corrupted Items";
}
}

public string Help
{
get
{
return "Corrupted Items";
}
}

public FilterGroup Group
{
get
{
return FilterGroup.Default;
}
}

public bool Applicable(Item item)
{
return item.Corrupted;
}
}
}
44 changes: 44 additions & 0 deletions Procurement/ViewModel/Filters/ForumExport/IdentifiedItemFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using POEApi.Model;

namespace Procurement.ViewModel.Filters.ForumExport
{
public class IdentifiedItemFilter : IFilter
{
public bool CanFormCategory
{
get
{
return false;
}
}

public string Keyword
{
get
{
return "Identified Items";
}
}

public string Help
{
get
{
return "Identified Items";
}
}

public FilterGroup Group
{
get
{
return FilterGroup.Default;
}
}

public bool Applicable(Item item)
{
return item.Identified && item.ItemLevel > 0 && !(item.StackSize > 0) && !(item is Incubator) && !(item is FullBestiaryOrb);
}
}
}
48 changes: 48 additions & 0 deletions Procurement/ViewModel/Filters/ForumExport/UncorruptedItemFilter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
using POEApi.Model;

namespace Procurement.ViewModel.Filters.ForumExport
{
public class UncorruptedItemFilter : IFilter
{
public bool CanFormCategory
{
get
{
return false;
}
}

public string Keyword
{
get
{
return "Uncorrupted Items";
}
}

public string Help
{
get
{
return "Uncorrupted Items";
}
}

public FilterGroup Group
{
get
{
return FilterGroup.Default;
}
}

public bool Applicable(Item item)
{
Gear gear = item as Gear;

return !item.Corrupted
&& (item is Gem || (item.ItemLevel > 0 && !(item.StackSize > 0) && (!gear?.GearType.Equals(GearType.Flask) ?? true)))
&& !(item is Incubator) && !(item is FullBestiaryOrb);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using POEApi.Model;

namespace Procurement.ViewModel.Filters.ForumExport
{
public class UnidentifiedItemFilter : IFilter
{
public bool CanFormCategory
{
get
{
return false;
}
}

public string Keyword
{
get
{
return "Unidentified Items";
}
}

public string Help
{
get
{
return "Unidentified Items";
}
}

public FilterGroup Group
{
get
{
return FilterGroup.Default;
}
}

public bool Applicable(Item item)
{
// Item types that can't be unidentified always have identified value as true so a simple check is sufficient
return !item.Identified;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For items that can't be unidentified, is item.Identified always true? If so, add a comment explaining this, and thus why we don't need a more complicated check (like we do for the IdentifiedItemFilter).

Copy link
Contributor Author

@nqrcqn nqrcqn Sep 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes that appears to be the case, haven't seen any issues with the way these filters work

}
}
}