using System.Collections.Generic;

namespace PortfolioManager.Renderers
{
  public class OffsetDictionary
  {
    public enum OffsetType
    {
      VerticalOffset15PC, VerticalOffset10PC, VerticalOffset7PC, VerticalOffset6P5PC, VerticalOffset6PC, VerticalOffset5PC, VerticalOffset3PC, VerticalOffset1PC, HorizontalOffset5PC, HorizontalOffset3PC, HorizontalOffset1PC,
      MinBollingerDate, MaxBollingerDate, MinBollingerValue, MaxBollingerValue
    };

    private Dictionary<OffsetType, double> offsetDictionary = new Dictionary<OffsetType, double>();

    /// <summary>
    /// Gets/Sets the Maximum bollinger date in AODate form
    /// </summary>
    public double MaxBollingerDate { get; set; }
    
    /// <summary>
    /// Gets/Sets the Minumum bollinger date in AODate form
    /// </summary>
    public double MinBollingerDate { get; set; }
    
    /// <summary>
    /// Gets/Sets the Maximum bollinger value
    /// </summary>
    public double MaxBollingerValue { get; set; }
    
    /// <summary>
    /// Gets/Sets the Minimum bollinger value
    /// </summary>
    public double MinBollingerValue { get; set; }
    
    /// <summary>
    /// Gets/Sets the Horizontal Spread (max-min)
    /// </summary>
    public double HorizontalSpread { get; set; }
    
    
    /// <summary>
    /// Gets/Sets the Vertical Spread (max-min)
    /// </summary>
    public double VerticalSpread { get; set; }
    
    /// <summary>
    /// Add an offset and it's offset type
    /// </summary>
    /// <param name="offsetType"></param>
    /// <param name="value"></param>
    public void Add(OffsetType offsetType, double value)
    {
      if (offsetDictionary.ContainsKey(offsetType))
      {
        offsetDictionary[offsetType] = value;
      }
      else
      {
        offsetDictionary.Add(offsetType, value);
      }
    }

    /// <summary>
    /// Get the offset specified by offsetType
    /// </summary>
    /// <param name="offsetType"></param>
    /// <returns></returns>
    public double Offset(OffsetType offsetType)
    {
      return offsetDictionary[offsetType];
    }    
  }
}