Пример #1
0
        /// <summary>
        /// Compiles all game object which are used in the mission.
        /// </summary>
        /// <param name="node">The node with names and paths of the compiling objects.</param>
        private void CompileUsedObjects(XmlNode node)
        {
            var synatexTreeList = new List <SyntaxTree>();
            var compiled        = new List <string>();

            foreach (XmlNode usedObj in node.ChildNodes)
            {
                foreach (XmlNode obj in usedObj)
                {
                    string fullPath = obj.Attributes["path"].InnerText;
                    string type     = obj.Attributes["name"].InnerText;;
                    if (!compiled.Contains(type))
                    {
                        compiled.Add(type);
                        var syntaxTree = SyntaxTree.ParseFile("../../GameObjectControl/Game Objects/" + fullPath);
                        synatexTreeList.Add(syntaxTree);
                    }
                }
            }
            runtimeCtor.CompileUsedObjects(synatexTreeList);
        }