public static void Initialize()
		{
			Element element = ConfigParser.GetConfig( kConfigFile, kConfigName );

			if ( null == element || element.ChildElements.Count <= 0 )
				return;

			double tempDouble;
			bool tempBool;
			int tempInt;
			Type[] tempTypeArray;

			foreach( Element child in element.ChildElements ) 
			{
				if ( child.TagName == "PetAsStatuette" && child.GetBoolValue( out tempBool ))
					PetAsStatuette = tempBool;
				
				else if ( child.TagName == "AllowLocking" && child.GetBoolValue( out tempBool ))
					AllowLocking = tempBool;
				
				else if ( child.TagName == "ShowPetDetails" && child.GetBoolValue( out tempBool ))
					ShowPetDetails = tempBool;
				
				else if ( child.TagName == "ShrunkenWeight" && child.GetDoubleValue( out tempDouble ))
					ShrunkenWeight = tempDouble;
				
				else if ( child.TagName == "BlessedLeash" && child.GetBoolValue( out tempBool ))
					BlessedLeash = tempBool;
				
				else if ( child.TagName == "LootStatus" && null != child.Text && "" != child.Text )
				{
					if ( "BlessStatus.All" == child.Text )
						LootStatus = BlessStatus.All;
					else if ( "BlessStatus.BondedOnly" == child.Text )
						LootStatus = BlessStatus.BondedOnly;
					else if ( "BlessStatus.None" == child.Text )
						LootStatus = BlessStatus.None;
				}
				else if ( child.TagName == "TamingRequired" && child.GetIntValue( out tempInt ))
					TamingRequired = tempInt;
				
				else if ( child.TagName == "ShrinkCharges" && child.GetIntValue( out tempInt ))
					ShrinkCharges = tempInt;
				
				else if ( child.TagName == "PackAnimals" && child.GetArray( out tempTypeArray ))
					PackAnimals = tempTypeArray;
			}
		}
示例#2
0
        public static void Initialize()
        {
            Element element = ConfigParser.GetConfig(kConfigFile, kConfigName);

            if (null == element || element.ChildElements.Count <= 0)
            {
                return;
            }

            double tempDouble;
            bool   tempBool;
            int    tempInt;

            Type[] tempTypeArray;

            foreach (Element child in element.ChildElements)
            {
                if (child.TagName == "PetAsStatuette" && child.GetBoolValue(out tempBool))
                {
                    PetAsStatuette = tempBool;
                }

                else if (child.TagName == "AllowLocking" && child.GetBoolValue(out tempBool))
                {
                    AllowLocking = tempBool;
                }

                else if (child.TagName == "ShowPetDetails" && child.GetBoolValue(out tempBool))
                {
                    ShowPetDetails = tempBool;
                }

                else if (child.TagName == "ShrunkenWeight" && child.GetDoubleValue(out tempDouble))
                {
                    ShrunkenWeight = tempDouble;
                }

                else if (child.TagName == "BlessedLeash" && child.GetBoolValue(out tempBool))
                {
                    ShowPetDetails = tempBool;
                }

                else if (child.TagName == "LootStatus" && null != child.Text && "" != child.Text)
                {
                    if ("BlessStatus.All" == child.Text)
                    {
                        LootStatus = BlessStatus.All;
                    }
                    else if ("BlessStatus.BondedOnly" == child.Text)
                    {
                        LootStatus = BlessStatus.BondedOnly;
                    }
                    else if ("BlessStatus.None" == child.Text)
                    {
                        LootStatus = BlessStatus.None;
                    }
                }
                else if (child.TagName == "TamingRequired" && child.GetIntValue(out tempInt))
                {
                    TamingRequired = tempInt;
                }

                else if (child.TagName == "ShrinkCharges" && child.GetIntValue(out tempInt))
                {
                    ShrinkCharges = tempInt;
                }

                else if (child.TagName == "PackAnimals" && child.GetArray(out tempTypeArray))
                {
                    PackAnimals = tempTypeArray;
                }
            }
        }