Exemple #1
0
            public void             Load(Database _Owner, XmlElement _EntryElement)
            {
                m_RelativePath = _EntryElement.GetAttribute("RelativePath");
                m_FriendlyName = _EntryElement["FriendlyName"].GetAttribute("Value");
                m_Description  = _EntryElement["Description"].GetAttribute("Value");

                if (_EntryElement["EnvironmentImage"] != null)
                {
                    m_OverviewImageRelativePath = _EntryElement["EnvironmentImage"].GetAttribute("RelativePath");
                }

                XmlElement TagsElement = _EntryElement["Tags"];

                if (TagsElement == null)
                {
                    throw new Exception("Failed to retrieve \"Tags\" element!");
                }

                m_TagType         = (TAGS_TYPE)Enum.Parse(typeof(TAGS_TYPE), TagsElement["Type"].GetAttribute("Value"));
                m_TagColor        = (TAGS_COLOR)Enum.Parse(typeof(TAGS_COLOR), TagsElement["Color"].GetAttribute("Value"));
                m_TagShade        = (TAGS_SHADE)Enum.Parse(typeof(TAGS_SHADE), TagsElement["Shade"].GetAttribute("Value"));
                m_TagNature       = (TAGS_NATURE)Enum.Parse(typeof(TAGS_NATURE), TagsElement["Nature"].GetAttribute("Value"));
                m_TagFurniture    = (TAGS_FURNITURE)Enum.Parse(typeof(TAGS_FURNITURE), TagsElement["Furniture"].GetAttribute("Value"));
                m_TagConstruction = (TAGS_CONSTRUCTION)Enum.Parse(typeof(TAGS_CONSTRUCTION), TagsElement["Construction"].GetAttribute("Value"));
                m_TagModifiers    = (TAGS_MODIFIERS)Enum.Parse(typeof(TAGS_MODIFIERS), TagsElement["Modifiers"].GetAttribute("Value"));
            }
Exemple #2
0
            public void Load( Database _Owner, XmlElement _EntryElement )
            {
                m_RelativePath = _EntryElement.GetAttribute( "RelativePath" );
                m_FriendlyName = _EntryElement["FriendlyName"].GetAttribute( "Value" );
                m_Description = _EntryElement["Description"].GetAttribute( "Value" );

                if ( _EntryElement["EnvironmentImage"] != null )
                    m_OverviewImageRelativePath = _EntryElement["EnvironmentImage"].GetAttribute( "RelativePath" );

                XmlElement	TagsElement = _EntryElement["Tags"];
                if ( TagsElement == null )
                    throw new Exception( "Failed to retrieve \"Tags\" element!" );

                m_TagType = (TAGS_TYPE) Enum.Parse( typeof(TAGS_TYPE), TagsElement["Type"].GetAttribute( "Value" ) );
                m_TagColor = (TAGS_COLOR) Enum.Parse( typeof(TAGS_COLOR), TagsElement["Color"].GetAttribute( "Value" ) );
                m_TagShade = (TAGS_SHADE) Enum.Parse( typeof(TAGS_SHADE), TagsElement["Shade"].GetAttribute( "Value" ) );
                m_TagNature = (TAGS_NATURE) Enum.Parse( typeof(TAGS_NATURE), TagsElement["Nature"].GetAttribute( "Value" ) );
                m_TagFurniture = (TAGS_FURNITURE) Enum.Parse( typeof(TAGS_FURNITURE), TagsElement["Furniture"].GetAttribute( "Value" ) );
                m_TagConstruction = (TAGS_CONSTRUCTION) Enum.Parse( typeof(TAGS_CONSTRUCTION), TagsElement["Construction"].GetAttribute( "Value" ) );
                m_TagModifiers = (TAGS_MODIFIERS) Enum.Parse( typeof(TAGS_MODIFIERS), TagsElement["Modifiers"].GetAttribute( "Value" ) );
            }