﻿using System;
using System.Collections.Generic;
using System.Linq;
using PrepareLanding.Extensions;
using RimWorld;
using RimWorld.Planet;
using UnityEngine;
using Verse;

namespace PrepareLanding.Filters
{
    public abstract class TileFilter : ITileFilter
    {
        protected List<int> _filteredTiles = new List<int>();

        public abstract string SubjectThingDef { get; }

        public virtual List<int> FilteredTiles => _filteredTiles;

        public virtual string RunningDescription => $"Filtering {SubjectThingDef}";

        public string AttachedProperty { get; }
        public Action<PrepareLandingUserData, List<int>> FilterAction { get; }
        public FilterHeaviness Heaviness { get; }

        protected TileFilter(string attachedProperty, FilterHeaviness heaviness)
        {
            AttachedProperty = attachedProperty;
            Heaviness = heaviness;
            FilterAction = Filter;
        }

        public virtual void Filter(PrepareLandingUserData userData, List<int> inputList)
        {
            _filteredTiles.Clear();
        }
    }


}
﻿using System;
using System.Collections.Generic;
using System.Linq;
using PrepareLanding.Extensions;
using RimWorld;
using RimWorld.Planet;
using UnityEngine;
using Verse;

namespace PrepareLanding.Filters
{
    public abstract class TileFilter : ITileFilter
    {
        protected List<int> _filteredTiles = new List<int>();

        protected PrepareLandingUserData UserData;

        public abstract string SubjectThingDef { get; }

        public abstract bool IsFilterActive { get; }

        public virtual List<int> FilteredTiles => _filteredTiles;

        public virtual string RunningDescription => $"Filtering {SubjectThingDef}";

        public string AttachedProperty { get; }

        public Action<List<int>> FilterAction { get; }

        public FilterHeaviness Heaviness { get; }

        protected TileFilter(PrepareLandingUserData userData, string attachedProperty, FilterHeaviness heaviness)
        {
            UserData = userData;
            AttachedProperty = attachedProperty;
            Heaviness = heaviness;
            FilterAction = Filter;
        }

        public virtual void Filter(List<int> inputList)
        {
            _filteredTiles.Clear();
        }
    }


}
Add IsFilterActive; remove unneeded parameters for filter method (pass it on ctor)
Add IsFilterActive; remove unneeded parameters for filter method (pass it on ctor)
