using System.Collections.Generic;
using EscapeRoomEngine.Engine.Runtime.Modules;
using UnityEngine;

namespace EscapeRoomEngine.Engine.Runtime.Requirements
{
    /// <summary>
    /// This requirement places a module exactly in the same position as its first related module.
    /// </summary>
    [CreateAssetMenu(menuName = "Requirements/Place With Related Module")]
    public class PlaceWithRelatedModule : PlacementRequirement
    {
        protected override List<Placement> FilterCandidates(List<Placement> candidates, Module module, Space space)
        {
            return new List<Placement> { module.relatedModules[0].srPlacement };
        }
    }
}