public override bool Load(SecurityElement element)
 {
     if (element.Tag != "Items")
     {
         return(false);
     }
     if (element.Children != null)
     {
         foreach (SecurityElement ChildrenElement in element.Children)
         {
             if (ChildrenElement.Tag == "Item")
             {
                 DatingPlaceElement itemElement = new DatingPlaceElement();
                 itemElement.nGirlID       = StrParser.ParseDecInt(ChildrenElement.Attribute("Girl_ID"), -1);
                 itemElement.nPlaceID      = StrParser.ParseDecInt(ChildrenElement.Attribute("Place_ID"), -1);
                 itemElement.strPlaceName  = StrParser.ParseStr(ChildrenElement.Attribute("Place_Name"), "");
                 itemElement.nPlaceType    = StrParser.ParseDecInt(ChildrenElement.Attribute("Place_Type"), -1);
                 itemElement.nPlaceLevel   = StrParser.ParseDecInt(ChildrenElement.Attribute("Place_Need_Level"), -1);
                 itemElement.nMinIntimacy  = StrParser.ParseDecInt(ChildrenElement.Attribute("Need_Min_Intimacy"), -1);
                 itemElement.nMaxIntimacy  = StrParser.ParseDecInt(ChildrenElement.Attribute("Need_Max_Intimacy"), -1);
                 itemElement.nLovePointSub = StrParser.ParseDecInt(ChildrenElement.Attribute("LovePoint_Sub"), -1);
                 itemElement.nItemIDSub    = StrParser.ParseDecInt(ChildrenElement.Attribute("Item_ID_Sub"), -1);
                 itemElement.nItemNumSub   = StrParser.ParseDecInt(ChildrenElement.Attribute("Item_num_Sub"), -1);
                 itemElement.nQiaoDuanID   = StrParser.ParseDecInt(ChildrenElement.Attribute("QiaoDuan_ID"), -1);
                 _mItemElementList[itemElement.nPlaceID] = itemElement;
             }
         }
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
	public override bool Load (SecurityElement element)
	{
		if(element.Tag != "Items")
			return false;
		if(element.Children!=null)
		{
			foreach(SecurityElement ChildrenElement in element.Children)
			{
				if(ChildrenElement.Tag=="Item")
				{
					CustomElement itemElement = new CustomElement();
					itemElement.nCustomID = StrParser.ParseDecInt(ChildrenElement.Attribute("CustomID"),-1);
					itemElement.nCustomContent = ChildrenElement.Attribute("CustomContet");
					itemElement.nBoneCount = StrParser.ParseDecInt(ChildrenElement.Attribute("BoneCount"),0);
					itemElement.ValueBegin = StrParser.ParseDecInt(ChildrenElement.Attribute("ValueBegin"),0);
					itemElement.nBoneList = new List<BoneItemInfo>();
					for (int i=0; i<itemElement.nBoneCount; i++)
					{
						BoneItemInfo boneItemInfo = new BoneItemInfo();
						string strIter = "BoneName" + (i+1).ToString();
						boneItemInfo.boneName = ChildrenElement.Attribute(strIter);
						strIter = "Axis" + (i+1).ToString();
						boneItemInfo.nAxis = StrParser.ParseDecInt(ChildrenElement.Attribute(strIter),0);
						strIter = "PRS" + (i+1).ToString();
						boneItemInfo.nPRS = StrParser.ParseDecInt(ChildrenElement.Attribute(strIter),0);
						
						strIter = "IsWorld" + (i+1).ToString();
						if (ChildrenElement.Attribute(strIter) != "")
							boneItemInfo.nIsWorld = StrParser.ParseDecInt(ChildrenElement.Attribute(strIter),0);
						else
							boneItemInfo.nIsWorld = 0;
						
						strIter = "ValueRange" + (i+1).ToString();
						boneItemInfo.nValueRange = StrParser.ParseFloat(ChildrenElement.Attribute(strIter),0);
						
						strIter = "BigValueRange" + (i+1).ToString();
						boneItemInfo.nBigValueRange = StrParser.ParseFloat(ChildrenElement.Attribute(strIter),0);
						
						itemElement.nBoneList.Add(boneItemInfo);
					}
					_mItemElementList[itemElement.nCustomID] = itemElement;
				}
			}
			return true;
		}
		return false;
	}