ElementNode.IsTerminal C# (CSharp) Method

IsTerminal() public method

Does the node have no child ?
public IsTerminal ( Queue elements ) : bool
elements Queue The Queue of elements composing the spell.
return bool
    public bool IsTerminal(Queue<Element> elements)
    {
        if(elements.Count == 0)
        {
            return _nodes == null;
        }
        else
        {
            Element element = elements.Dequeue();
            if (!_nodes.ContainsKey(element))
            {
                throw new System.Exception("Elements not sorted");
            }
            return _nodes[element].IsTerminal(elements);
        }
    }