using SWRIS.Enums;
using System.ComponentModel;

namespace SWRIS.Dtos
{
    public class DamageDto : INotifyPropertyChanged
    {
        private int? _id;
        private int? _recordId;
        private float _damagePoint;
        private float _damageValue;
        private DamageLevel _damageLevel;

        public int? Id
        {
            get => _id;
            set
            {
                if (_id != value)
                {
                    _id = value;
                    OnPropertyChanged(nameof(Id));
                }
            }
        }
        /// <summary>
        /// 记录Id
        /// </summary>
        public int? RecordId
        {
            get => _recordId;
            set
            {
                if (_recordId != value)
                {
                    _recordId = value;
                    OnPropertyChanged(nameof(RecordId));
                }
            }
        }
        /// <summary>
        /// 位置 m
        /// </summary>
        public float DamagePoint
        {
            get => _damagePoint;
            set
            {
                if (_damagePoint != value)
                {
                    _damagePoint = value;
                    OnPropertyChanged(nameof(DamagePoint));
                }
            }
        }
        /// <summary>
        /// 损伤值
        /// </summary>
        public float DamageValue
        {
            get => _damageValue;
            set
            {
                if (_damageValue != value)
                {
                    _damageValue = value;
                    OnPropertyChanged(nameof(DamageValue));
                }
            }
        }
        /// <summary>
        /// 损伤程度
        /// </summary>
        public DamageLevel DamageLevel
        {
            get => _damageLevel;
            set
            {
                if (_damageLevel != value)
                {
                    _damageLevel = value;
                    OnPropertyChanged(nameof(DamageLevel));
                }
            }
        }


        public event PropertyChangedEventHandler PropertyChanged;
        protected internal virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}
