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

namespace FormulaEditor
{
    /// <summary>
    /// Math atan2 symbol
    /// </summary>
    public class BinaryFunctionSymbol : BracketsSymbol
    {
        /// <summary>
        /// The width
        /// </summary>
        //private int width;

        /// <summary>
        /// Constructor
        /// </summary>
        public BinaryFunctionSymbol(char symbol, string s)
        {
            type = (byte)2;
            if (s != null)
            {
                MathFormula.Resources.ContainsKey(s);
                this.s = MathFormula.Resources[s] as string;
            }
            if (this.s == null)
            {
                this.s = s;
            }
            this.symbol = symbol;
        }

        /// <summary>
        /// Sets itself to formula
        /// </summary>
        /// <param name="formula">The formula to set</param>
        public override void SetToFormula(MathFormula formula)
        {
            base.SetToFormula(formula);
            for (int i = 0; i < 2; i++)
            {
                children.Add(new MathFormula((byte)level, sizes));
            }
        }

        /// <summary>
        /// Clones itself
        /// </summary>
        /// <returns>The clone object</returns>
        public override object Clone()
        {
            return new BinaryFunctionSymbol(symbol, s);
        }

    }
}
