Ejemplo n.º 1
0
        /// <summary>
        /// Creates a DataAsset with the given filepath.
        /// </summary>
        /// <param name="fileName">The path to the file.</param>
        /// <param name="load">Whether to load the file immediately.</param>
        public DataAsset(string fileName, bool load)
        {
            FilePath = fileName;
            HeadNode = new DataNode("");

            if (load)
                Load();
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets a child at the given key to the given node.
 /// </summary>
 public DataNode SetChild(string key, DataNode node)
 {
     RemoveKey(key);
     children[key] = node;
     node.Parent = this;
     node.Key = key;
     return node;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Removes the given node from the current node.
 /// </summary>
 /// <param name="node"></param>
 public void RemoveChild(DataNode node)
 {
     children.Remove(node.Key);
     node.Parent = null;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Sets a child at the given node's key to the given node.
 /// </summary>
 public DataNode SetChild(DataNode node)
 {
     return SetChild(node.Key, node);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Adds a child node at the given key.
 /// </summary>
 public DataNode AddChild(string key)
 {
     var newChild = new DataNode(key);
     RemoveKey(key);
     children[key] = newChild;
     newChild.Parent = this;
     return newChild;
 }