using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace DeviceLibrary
{
    public enum ShelfType
    {
        None,
        Big,
        Small,
        Pack,
        Reel
    }
    public class Shelf
    {
        /// <summary>
        /// 料架rfid
        /// </summary>
        public string RFID { get; set; }
        /// <summary>
        /// 料架类型
        /// </summary>
        public ShelfType Type { get; set; }
        /// <summary>
        /// 料架是否有料
        /// </summary>
        public bool IsFull { get; set; }
        public Shelf(string rfid="",bool isFull=false,ShelfType type = ShelfType.None)
        {
            RFID = rfid;
            Type = type;
            IsFull = isFull;
        }

        public Shelf ToCopy()
        {
            PropertyInfo[] infos = this.GetType().GetProperties();
            Shelf shelf = new Shelf();
            PropertyInfo[] infos2 = shelf.GetType().GetProperties();
            for (int i = 0; i < infos2.Length; i++)
            {
                infos2[i].SetValue(shelf, infos[i].GetValue(this));
            }
            return shelf;
        }
    }
}