using System;
using System.Collections.Generic;
using Verse;
using Verse.AI.Group;

namespace ArachnaeSwarm
{
    public class CompProperties_SpawnPawnFromList : CompProperties
    {
        public List<PawnKindDef> pawnKinds;
        public List<PawnKindDef> whitelist;
        public int delay = 0;
        public bool destroyOnSpawn = false;
        public IntRange spawnCount = new IntRange(1, 1);
        public Type lordJob;
        public GraphicData hatchingGraphicData;

        public CompProperties_SpawnPawnFromList()
        {
            compClass = typeof(CompSpawnPawnFromList);
        }

        public override IEnumerable<string> ConfigErrors(ThingDef parentDef)
        {
            foreach (string item in base.ConfigErrors(parentDef))
            {
                yield return item;
            }
            if (lordJob != null && !typeof(LordJob).IsAssignableFrom(lordJob))
            {
                yield return $"lordJob {lordJob} must be of type LordJob";
            }
        }
    }
}