using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace s3sr.Classes
{
    public class Stencils
    {
        public class OBJDStencil
        {
            public ulong IMG_ReplaceInstance;
            public ulong IMG_Instance;
            public uint StencilID;

            public OBJDStencil(string val)
            {
                string[] arr = val.Split(';');
                this.IMG_ReplaceInstance = Convert.ToUInt64(arr[0], 16);
                this.IMG_Instance = Convert.ToUInt64(arr[1], 16);
                this.StencilID = Convert.ToUInt32(arr[2], 16);
            }
        }

        /// <summary>
        /// Build OBJDStencil List from String Pattern
        /// </summary>
        /// <param name="val">String Pattern</param>
        /// <returns></returns>
        public static List<OBJDStencil> BuildList(string[] val)
        {
            List<OBJDStencil> ret = new List<OBJDStencil>();
            foreach(string StencilVal in val)
                ret.Add(new OBJDStencil(StencilVal.Split(':')[1]));
            return ret;
        }
    }
}