﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="MachineModel.cs" company="Fox Council">
//   Fox Council
// </copyright>
// <summary>
//   Class MachineModel.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace MineAPI.EditorBase.Model
{
    using System.IO;

    using PropertyChanged;

    /// <summary>
    ///     Class MachineModel.
    /// </summary>
    [ImplementPropertyChanged]
    public class MachineModel
    {
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="MachineModel"/> class.
        /// </summary>
        /// <param name="modelPath">
        /// The model path.
        /// </param>
        /// <param name="visible">
        /// if set to <c>true</c> [visible].
        /// </param>
        public MachineModel(string modelPath, bool visible)
        {
            ModelPath = modelPath;
            ModelVisible = visible;
        }

        #endregion

        #region Public Properties

        /// <summary>
        ///     Gets or sets the model path.
        /// </summary>
        /// <value>The model path.</value>
        /// <returns>string.</returns>
        public string ModelPath { get; set; }

        /// <summary>
        ///     Gets or sets a value indicating whether [model visible].
        /// </summary>
        /// <value><c>true</c> if [model visible]; otherwise, <c>false</c>.</value>
        /// <returns>bool.</returns>
        public bool ModelVisible { get; set; }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        ///     To the string.
        /// </summary>
        /// <returns>string.</returns>
        public override string ToString()
        {
            string modelFileName = Path.GetFileName(ModelPath);
            if (!string.IsNullOrEmpty(modelFileName))
            {
                return modelFileName;
            }

            return "[No Model]";
        }

        #endregion
    }
}