Esempio n. 1
0
        public ResourcesData(string filePath)
        {
            _filePath = filePath;

            if (File.Exists(_filePath))
            {
                _resourcesDocument = new XmlDocument();
                _resourcesDocument.Load(_filePath);
                _container = new Container(_resourcesDocument.DocumentElement, null);
            }
        }
Esempio n. 2
0
        public Container(XmlNode node,Container parentContainer)
        {
            Containers = new List<Container>();
            Name = node.Name;
            Shaders = new List<Shader>();
            Models = new List<Model>();
            TexturePacks = new List<TexturePack>();
            Particles = new List<Particles>();
            if (node.ParentNode != null)
            {
                ParentContainer = parentContainer;
            }

            _node = (XmlElement)node;
            LoadFromXML(_node);
        }
Esempio n. 3
0
        public Shader(XmlNode node, Container parentContainer)
        {
            _node = (XmlElement)node;

            ParentContainer = parentContainer;
        }
Esempio n. 4
0
 public void AddContainer(Container container)
 {
     _node.AppendChild(container._node);
     Containers.Add(container);
     _newNode = true;
 }
Esempio n. 5
0
 private void LoadFromXML(XmlNode parentNode)
 {
     foreach (XmlElement nodes in parentNode)
     {
         switch (GetType(nodes))
         {
             case "container":
                 Container newContainer = new Container(nodes, this);
                 Containers.Add(newContainer);
                 break;
             case "shader":
                 //Shaders.GetShader(nodes);
                 Shader newShader = new Shader(nodes, this);
                 Shaders.Add(newShader);
                 break;
             case "model":
                 Model newModel = new Model(nodes, this);
                 Models.Add(newModel);
                 break;
             case "texture_pack":
                 TexturePack newTexturePack = new TexturePack(nodes, this);
                 TexturePacks.Add(newTexturePack);
                 break;
             case "particles":
                 Particles newParticles = new Particles(nodes, this);
                 Particles.Add(newParticles);
                 break;
             default:
                 //System.Windows.Forms.MessageBox.Show("Error! Unsigned node detected!");
                 break;
         }
     }
 }
Esempio n. 6
0
 public void DeleteContainer(Container container)
 {
     Containers.Remove(container);
 }
Esempio n. 7
0
 public Container CreateContainer(string containerName)
 {
     XmlElement containerNode = _node.OwnerDocument.CreateElement(containerName);
     Container containter = new Container(containerNode, this);
     return containter;
 }
Esempio n. 8
0
 public string SearchShaderPathInContainersByName(Container container, string shaderName, string outputShaderNodeValue)
 {
     outputShaderNodeValue = container.GetShaderPathByName(shaderName);
     if ((outputShaderNodeValue == String.Empty) && (container.Containers.Count > 0))
     {
         foreach (Container cont in container.Containers)
         {
             outputShaderNodeValue = cont.GetShaderPathByName(shaderName);
             if (outputShaderNodeValue == String.Empty)
             {
                 if (container.Containers.Count > 0)
                 {
                     outputShaderNodeValue = SearchShaderPathInContainersByName(cont, shaderName, outputShaderNodeValue);
                     if (outputShaderNodeValue != String.Empty)
                     {
                         return outputShaderNodeValue;
                     }
                 }
             }
             else
             {
                 return outputShaderNodeValue;
             }
         }
     }
     if (outputShaderNodeValue != String.Empty)
     {
         return outputShaderNodeValue;
     }
     return String.Empty;
 }
Esempio n. 9
0
        public Particles(XmlNode node, Container parentContainer)
        {
            _node = (XmlElement)node;

            ParentContainer = parentContainer;
        }
Esempio n. 10
0
        public TexturePack(XmlNode node, Container parentContainer)
        {
            _node = (XmlElement)node;

            ParentContainer = parentContainer;
        }