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

namespace Framework.StatSystem
{
    /// <summary>
    /// A null implementation of <see cref="Stat"/> that can be used when a stat
    /// was not found.
    /// </summary>
    [Obsolete("Not currently required")]
    public class NullStat : Statlike
    {
        /// <summary>
        /// Performs an implicit conversion from <see cref="Stat"/> to <see cref="System.Single"/>.
        /// </summary>
        /// <param name="self">The self.</param>
        /// <returns>
        /// The result of the conversion.
        /// </returns>
        public static implicit operator float(NullStat self)
        {
            return self.GetValue();
        }

        private float value;

        /// <summary>
        /// Initializes a new instance of the <see cref="NullStat"/> class.
        /// </summary>
        public NullStat()
        {
            this.value = 1f;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="NullStat"/> class.
        /// </summary>
        public NullStat(float value)
        {
            this.value = value;
        }

        public string GetName()
        {
            return "Null";
        }

        /// <summary>
        /// Sets the superstat of this stat, the stat should then inherit 
        /// modifiers from its super stat.
        /// </summary>
        /// <param name="superstat">The superstat.</param>
        public void SetSuperstat(Statlike superstat) { }

        /// <summary>
        /// Adds a modifier to this variable.
        /// </summary>
        /// <param name="modifier">The modifier.</param>
        public void AddModifier(Modifierlike modifier) { }

        /// <summary>
        /// Removes a modifier from this variable.
        /// </summary>
        /// <param name="modifier">The modifier.</param>
        public void RemoveModifier(Modifierlike modifier) { }

        /// <summary>
        /// Removes a modifier from this variable by type and strength.
        /// </summary>
        /// <typeparam name="ModifierType">The type of the odifier type.</typeparam>
        /// <param name="value">The value.</param>
        public void RemoveModifier<ModifierType>(float strength) where ModifierType : Modifierlike { }

        /// <summary>
        /// Returns the current modifiers applied to this variable.
        /// </summary>
        /// <returns></returns>
        public List<Modifierlike> GetModifiers()
        {
            return new List<Modifierlike>();
        }

        /// <summary>
        /// Gets the value of this variable with modifications applied. 
        /// </summary>
        /// <returns></returns>
        public float GetValue()
        {
            return this.value;
        }

        /// <summary>
        /// Gets the current mid calculation value of this variable, should only be used for
        /// modifier processing.
        /// </summary>
        /// <returns></returns>
        public float GetCurrentValue()
        {
            return this.value;
        }

        /// <summary>
        /// Gets the base value of this variable before modifications have been applied.
        /// </summary>
        /// <returns></returns>
        public float GetBaseValue()
        {
            return this.value;
        }
    }
}
