Exemple #1
0
        private void parseClassDefinitionMetadata(XmlNode definition)
        {
            string          worldName;
            WorldDefinition worldDefinition;

            if (definition.Attributes.GetNamedItem(XMLConfig.worldAttribute) != null)
            {
                worldName       = definition.Attributes[XMLConfig.worldAttribute].Value;
                worldDefinition = new WorldDefinition();
                foreach (XmlNode child in definition.ChildNodes)
                {
                    if (child.Name == XMLConfig.stateVarTag)
                    {
                        worldDefinition.addStateVar(new StateVar(child));
                    }
                    else if (child.Name == XMLConfig.actionVarTag)
                    {
                        worldDefinition.addActionVar(new ActionVar(child));
                    }
                    else if (child.Name == XMLConfig.constantTag)
                    {
                        worldDefinition.addConstant(child.Attributes[XMLConfig.nameAttribute].Value);
                    }
                }
                m_worldDefinitions.Add(worldName, worldDefinition);
            }
        }