static bool EnumEvents(TreeNode node)
        {
            if (node == null)
            {
                return(true);
            }
            if (node.Left != null)
            {
                if (!EnumEvents(node.Left))
                {
                    return(false);
                }
            }
            WorldEvent e = node.Data as WorldEvent;

            if (e.eventTime > now)
            {
                return(false);
            }
            TreeNode right = node.Right;

            RemoveEvent(e);
            Console.WriteLine("Firing event " + e.ToString());
            e.FireEvent();
            if (right != null)
            {
                return(EnumEvents(right));
            }
            return(false);
        }
 public static void AddEvent(WorldEvent e)
 {
     if (e.Node != null)
     {
         return;
     }
     m_numEvents++;
     e.Node = m_tree.AddData(e);
 }
 public static void RemoveEvent(WorldEvent e)
 {
     if (e.Node == null)
     {
         return;
     }
     m_numEvents--;
     m_tree.RemoveNode(e.Node);
     e.Node = null;
 }