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

namespace Framework.StatSystem
{
    /// <summary>
    /// Used to apply a shifting modification to a <see cref="ModifiableVariable"/>
    /// often a <see cref="Stat"/>. Shifts the variable by adding or subtracting
    /// an ammount.
    /// </summary>
    public class ShiftModifier : Modifierlike
    {
        float ammount; // Amount to shift by

        /// <summary>
        /// Initializes a new instance of the <see cref="ShiftModifier"/> class.
        /// </summary>
        /// <param name="ammount">The ammount.</param>
        public ShiftModifier(float ammount)
        {
            this.ammount = ammount;
        }

        /// <summary>
        /// Gets the strength of this modifier.
        /// </summary>
        /// <returns></returns>
        public float GetStrength()
        {
            return this.ammount;
        }

        /// <summary>
        /// Applies this modifier.
        /// </summary>
        /// <param name="stat">The stat.</param>
        /// <returns></returns>
        public float Apply(ModifiableVariable stat)
        {
            return stat.GetCurrentValue() + this.ammount; 
        }
    }
}
