namespace ZelWiki.Models.DataModels
{
    public class ProcessingInstructionCollection
    {
        public List<ProcessingInstruction> Collection { get; set; } = new();

        /// <summary>
        /// 如果集合包含给定的处理指令，则返回true
        /// </summary>
        /// <param name="wikiInstruction">WikiInstruction.Protect</param>
        /// <returns></returns>
        public bool Contains(string wikiInstruction)
            => Collection.Any(o => string.Equals(o.Instruction, wikiInstruction, StringComparison.InvariantCultureIgnoreCase));
    }
}
