using Decal.Interop.Filters;

namespace Decal.Adapter.Wrappers;

/// <summary>
/// Defines the WorldObjectCollection filter for objects having the same category
/// </summary>
public class ByCategoryFilter : WorldObjectCollectionFilter
{
	private int category;

	/// <summary>
	/// Category of the items in this collection
	/// </summary>
	public int Category
	{
		get
		{
			return category;
		}
		set
		{
			category = value;
		}
	}

	/// <summary>
	/// Creates a new filter
	/// </summary>
	public ByCategoryFilter()
	{
	}

	/// <summary>
	/// Creates a new filter using the specified category
	/// </summary>
	/// <param name="category">Category to filter by</param>
	public ByCategoryFilter(int category)
	{
		this.category = category;
	}

	internal override void ApplyFilter(WorldIterator wi)
	{
		wi.ByCategory(category);
	}

	internal override void ApplyFilter(Decal.Interop.Filters.Vendor ven)
	{
		ven.ByCategory(category);
	}
}
