//---------------------------------------------------------------------------------------------------------------------------------------------------
//
// Copyright (C)2007 DarkWynter Studios. All rights reserved.
//
//---------------------------------------------------------------------------------------------------------------------------------------------------
// {Contact : darkwynter.com for licensing information
//---------------------------------------------------------------------------------------------------------------------------------------------------
namespace DarkWynter.Engine.Compiler
{
#region Using Statements
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
#endregion
public class Tree
{
public Node root;
///
/// Initializes the Tree with the nodes attached
///
/// The ID number of the Node
/// Left child (can be null)
/// Right child (can be null)
/// The letter representing the node
public Tree(int dNode, Node lNode, Node rNode, char d2Node)
{
root = new Node(dNode, lNode, rNode, d2Node);
}
///
/// Creates the tree
///
public Tree()
{
Node node15 = new Node(15, null, null, 'F');
Node node14 = new Node(14, null, null, 'E');
Node node13 = new Node(13, node15, node14, 'D');
Node node12 = new Node(12, null, null, 'C');
Node node11 = new Node(11, null, null, 'B');
Node node10 = new Node(10, node12, node11, 'A');
Node node9 = new Node(9, node13, node10, '9');
Node node8 = new Node(8, null, null, '8');
Node node7 = new Node(7, null, null, '7');
Node node6 = new Node(6, node8, node7, '6');
Node node5 = new Node(5, null, null, '5');
Node node4 = new Node(4, null, null, '4');
Node node3 = new Node(3, node5, node4, '3');
Node node2 = new Node(2, node6, node3, '2');
Node node1 = new Node(1, node9, node2, '1');
root = node1;
}
///
/// Checks to see if the tree is empty
///
/// Bool of root state
public bool isEmpty()
{
return root == null;
}
}
}