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

namespace EscapeRoomEngine.Engine.Runtime.Requirements
{
    /// <summary>
    /// This requirement forces a specific orientation.
    /// </summary>
    [CreateAssetMenu(menuName = "Requirements/Lock Orientation")]
    public class LockOrientation : PlacementRequirement
    {
        public Orientation orientation;
        
        protected override List<Placement> FilterCandidates(List<Placement> candidates, Module module, Space space)
        {
            candidates.RemoveAll(candidate => candidate.orientation != orientation);

            return candidates;
        }
    }
}