using System;
using System.Collections.ObjectModel;
using Prism.Mvvm;

namespace XplorePlane.ViewModels
{
    public class PipelineNodeViewModel : BindableBase
    {
        private string _displayName;
        private string _iconPath;
        private int _order;
        private bool _isSelected;
        private bool _isEnabled = true;

        public PipelineNodeViewModel(string operatorKey, string displayName, string iconPath = null)
        {
            Id = Guid.NewGuid();
            OperatorKey = operatorKey;
            _displayName = displayName;
            _iconPath = iconPath ?? string.Empty;
            Parameters = new ObservableCollection<ProcessorParameterVM>();
        }

        public Guid Id { get; }
        public string OperatorKey { get; }

        public string DisplayName
        {
            get => _displayName;
            set => SetProperty(ref _displayName, value);
        }

        public string IconPath
        {
            get => _iconPath;
            set => SetProperty(ref _iconPath, value);
        }

        public int Order
        {
            get => _order;
            set => SetProperty(ref _order, value);
        }

        public bool IsSelected
        {
            get => _isSelected;
            set => SetProperty(ref _isSelected, value);
        }

        public bool IsEnabled
        {
            get => _isEnabled;
            set => SetProperty(ref _isEnabled, value);
        }

        public ObservableCollection<ProcessorParameterVM> Parameters { get; }
    }
}
