/// <summary>
        /// Pushes the element on the stack. If an opposing element exists, remove this element;
        /// TODO: Optimize it by using an Array (no resizing etc.) 
        /// </summary>
        /// <param name="element">Element that should be pushed back</param>
        public void Push(Element element)
        {


            Element opposingElement = elements.Find((Element otherElement) =>
            {
                return element.OpposingElementName == otherElement.ElementType; //Find opposing Element
        });


            if (opposingElement != null)
            {
                elements.Remove(opposingElement); // Remove that element, if not null
                RaiseElementRemoved(opposingElement);
                return;
            }

            // If less than 3 elements are in the stack, push that element back.
            if (elements.Count < 3)
            {
                elements.Add(element);
                RaiseOnElementPushed(element);
            }
        }
 private void RaiseOnElementPushed(Element element)
 {
     if (ElementPushed != null)
     {
         ElementPushed(this, new PushedEventArgs(element));
     }
 }
        private void RaiseElementRemoved(Element opposingElement)
        {
            if (ElementRemoved != null)
            {
                ElementRemoved.Invoke(this, new RemovedEventArgs(opposingElement));

            }
        }
 public PushedEventArgs(Element pushedElement)
 {
     PushedElement = pushedElement;
 }
 public RemovedEventArgs(Element removedElement)
 {
     RemovedElement = removedElement;
 }