private bool LoadItemElement(SecurityElement element, out RoleRankFeatObject itemElement) { itemElement = new RoleRankFeatObject(); string attribute = element.Attribute("Role_Rank"); if (attribute != null) { itemElement.Role_Rank = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Item_ID"); if (attribute != null) { itemElement.Item_ID = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Feat"); if (attribute != null) { itemElement.Feat = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("General_Command_Modify"); if (attribute != null) { itemElement.General_Command_Modify = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("General_Intelligence_Modify"); if (attribute != null) { itemElement.General_Intelligence_Modify = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("General_Chivalrous_Modify"); if (attribute != null) { itemElement.General_Chivalrous_Modify = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Max_Life_Modify"); if (attribute != null) { itemElement.Max_Life_Modify = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Max_Ship_Num"); if (attribute != null) { itemElement.Max_Ship_Num = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("General_Skill"); if (attribute != null) { itemElement.General_Skill = StrParser.ParseDecInt(attribute, 0); } return(true); }
private int GetGameEndingState(string str) { if (mCacheList.Count > 0) { List <int> endingList = new List <int>(); string[] vecs = str.Split('|'); for (int i = 0; i < vecs.Length; i++) { endingList.Add(StrParser.ParseDecInt(vecs[i], -1)); } foreach (int taskid in endingList) { foreach (int id in mCacheList) { if (taskid > 0 && id > 0 && taskid == id) { return(taskid); } } } } return(-1); }
private bool LoadGameEndElement(SecurityElement element, out GameEndElement itemElement) { itemElement = new GameEndElement(); string attribute = element.Attribute("ID"); if (attribute != null) { itemElement.ID = StrParser.ParseDecInt(attribute, -1); } attribute = element.Attribute("End_Pic"); if (attribute != null) { itemElement.End_Pic = StrParser.ParseStr(attribute, ""); } attribute = element.Attribute("Get_Task"); if (attribute != null) { itemElement.Get_Task = StrParser.ParseStr(attribute, ""); } return(true); }
public static RoomObject Load(SecurityElement element) { RoomObject roomObject = new RoomObject(); roomObject.ID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Room_LV"), ""), -1); roomObject.Room_Describe = StrParser.ParseStr(element.Attribute("Room_Describe"), ""); string Condition = StrParser.ParseStr(element.Attribute("Lv_Up_Condition"), ""); if (Condition != null && Condition != "") { string[] vecs = Condition.Split(','); roomObject._needList.Clear(); foreach (string Conditionstring in vecs) { string [] datastring = Conditionstring.Split(':'); RoomNeedData roomNeedData = new RoomNeedData(); roomNeedData.NeedID = StrParser.ParseDecInt(datastring[0], -1); roomNeedData.NeedNum = StrParser.ParseDecInt(datastring[1], -1); roomObject._needList.Add(roomNeedData); } } roomObject._need_Role_Rank = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Role_Rank"), ""), -1); roomObject._effect_Energy = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Effect_Energy"), ""), -1); roomObject._effect_LovePoint = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Effect_LovePoint"), ""), -1); roomObject._flowerpot_Count = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Flowerpot_Count"), ""), -1); roomObject._functionId = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("functionId"), ""), -1); return(roomObject); }
private string getSpeakerName(string configName) { string meStr = Globals.Instance.MDataTableManager.GetWordText(4001); string colorStr = ""; // if (configName != meStr && configName != "") // { // colorStr = "[Ff6979]"; // } // else // { // colorStr = "[5D6D9E]"; // } int npcLogicID = StrParser.ParseDecInt(configName, 0); if (npcLogicID != 0) { Dictionary <long, GirlData> dicWarShipData = Globals.Instance.MGameDataManager.MActorData.GetWarshipDataList(); foreach (GirlData girlData in dicWarShipData.Values) { // if (girlData.BasicData.LogicID == npcLogicID) // return colorStr + girlData.BasicData.Name; } } return(colorStr + configName); }
public static WarshipEvolutionObject Load(SecurityElement element) { WarshipEvolutionObject warshipevolutionObject = new WarshipEvolutionObject(); warshipevolutionObject.Id = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Id"), ""), -1); warshipevolutionObject.WarshipID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Warship_Id"), ""), -1); warshipevolutionObject.Evolution_Level = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Evolution_Level"), ""), -1); warshipevolutionObject.Init_Art_Value = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Init_Art_Value"), ""), -1); warshipevolutionObject.Init_Art_Profile = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Init_Art_Profile"), ""), -1); warshipevolutionObject.Change_Art_Value = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Change_Art_Value"), ""), -1); warshipevolutionObject.Change_Art_Profile = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Change_Art_Profile"), ""), -1); warshipevolutionObject.Art_Max_Level = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Art_Max_Level"), ""), -1); warshipevolutionObject.New_Skill = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("New_Skill"), ""), -1); warshipevolutionObject.Need_Level = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Level"), ""), -1); warshipevolutionObject.Need_Item1 = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Item1"), ""), -1); warshipevolutionObject.Need_Num1 = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Num1"), ""), -1); warshipevolutionObject.Need_Item2 = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Item2"), ""), -1); warshipevolutionObject.Need_Num2 = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Num2"), ""), -1); warshipevolutionObject.Need_Warship_ID1 = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Warship_ID1"), ""), -1); warshipevolutionObject.Need_Warship_Evolution1 = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Warship_Evolution1"), ""), -1); warshipevolutionObject.Need_Warship_Num1 = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Warship_Num1"), ""), -1); warshipevolutionObject.Need_Warship_ID2 = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Warship_ID2"), ""), -1); warshipevolutionObject.Need_Warship_Evolution2 = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Warship_Evolution2"), ""), -1); warshipevolutionObject.Need_Warship_Num2 = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Need_Warship_Num2"), ""), -1); return(warshipevolutionObject); }
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); }
private bool LoadDiamondToGoldElement(SecurityElement element, out DiamondToGoldElement itemElement) { itemElement = new DiamondToGoldElement(); string attribute = element.Attribute("ID"); if (attribute != null) { itemElement.ID = StrParser.ParseDecInt(attribute, -1); } attribute = element.Attribute("Need_Diamond"); if (attribute != null) { itemElement.Need_Diamond = StrParser.ParseDecInt(attribute, -1); } attribute = element.Attribute("Get_Gold"); if (attribute != null) { itemElement.Get_Gold = StrParser.ParseDecInt(attribute, -1); } attribute = element.Attribute("Icon"); if (attribute != null) { itemElement.Icon = StrParser.ParseStr(attribute, ""); } return(true); }
private IEnumerator RequestIdafResult() { string http = "http://106.75.198.104:18000/advice?idfa=" + GameDefines.systemIFAD + "&idfv=null&stage=0"; WWW ret = new WWW(http); yield return(ret); if (ret.error != null) { Debug.LogError("error:" + ret.error); yield break; } string result = ret.text; if (string.IsNullOrEmpty(result)) { yield break; } JsonData jd = JsonMapper.ToObject(result); bool isSuccess = StrParser.ParseBool(jd[0].ToString(), false); if (!isSuccess && !isReVerification) { isReVerification = true; VerificationIdaf(); } }
private bool LoadItemElement(SecurityElement element, out ModelRoundLevelObject itemElement) { itemElement = new ModelRoundLevelObject(); string attribute = element.Attribute("Level"); if (attribute != null) { itemElement.Level = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Need_Level"); if (attribute != null) { itemElement.Need_Level = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Need_Score_Weight"); if (attribute != null) { itemElement.Need_Score_Weight = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Reward_Money_Weight"); if (attribute != null) { itemElement.Reward_Money_Weight = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Reward_Exp_Weight"); if (attribute != null) { itemElement.Reward_Exp_Weight = StrParser.ParseDecInt(attribute, 0); } int keyInt = 0; string valueStr = ""; attribute = element.Attribute("Level_Type1"); if (attribute != null) { keyInt = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Level_Type1_Text"); if (attribute != null) { valueStr = StrParser.ParseStr(attribute, ""); } itemElement.natureItemInfo.Add(keyInt, valueStr); attribute = element.Attribute("Level_Type2"); if (attribute != null) { keyInt = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Level_Type2_Text"); if (attribute != null) { valueStr = StrParser.ParseStr(attribute, ""); } itemElement.natureItemInfo.Add(keyInt, valueStr); return(true); }
private bool Loadg_level_infoElement(SecurityElement element, out AttrGradeElement itemElement) { itemElement = new AttrGradeElement(); string attribute = element.Attribute("AttrType"); if (attribute != null) { itemElement.AttrType = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("AttrGrade"); if (attribute != null) { itemElement.AttrGrade = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("NeedAttrNum"); if (attribute != null) { itemElement.NeedAttrNum = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("ScoreRatio"); if (attribute != null) { itemElement.ScoreRatio = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("ID"); if (attribute != null) { itemElement.ID = StrParser.ParseDecInt(attribute, 0); } return(true); }
public bool LoadSkillParticleElement(SecurityElement element, out SkillParticleElement particleElement) { particleElement = new SkillParticleElement(); if (element.Tag != "Particle") { return(false); } string attribute = element.Attribute("Asset"); if (attribute != null) { particleElement._particleAssetName = StrParser.ParseStr(attribute, ""); } attribute = element.Attribute("DelayTime"); if (attribute != null) { particleElement._particleDelayTime = StrParser.ParseFloat(attribute, 0.0f); } attribute = element.Attribute("DurationTime"); if (attribute != null) { particleElement._particleDurationTime = StrParser.ParseFloat(attribute, 0.0f); } attribute = element.Attribute("ShakeCamera"); if (attribute != null) { particleElement._shakeCamera = bool.Parse(attribute); } return(true); }
/// <summary> /// Loads the skill sound element. /// </summary> /// <returns> /// The skill sound element. /// </returns> /// <param name='element'> /// If set to <c>true</c> element. /// </param> /// <param name='soundElement'> /// If set to <c>true</c> sound element. /// </param> public bool LoadSkillSoundElement(SecurityElement element, out SkillSoundElement soundElement) { soundElement = new SkillSoundElement(); if (element.Tag != "Sound") { return(false); } string attribute = element.Attribute("Asset"); if (attribute != null) { soundElement._soundAssetName = StrParser.ParseStr(attribute, ""); } attribute = element.Attribute("Loop"); if (attribute != null) { soundElement._soundIsLoop = StrParser.ParseBool(attribute, false); } attribute = element.Attribute("Volume"); if (attribute != null) { soundElement._soundVolume = StrParser.ParseFloat(attribute, 100.0f); } return(true); }
private bool LoadMusicElement(SecurityElement element, out MusicElement obj) { obj = new MusicElement(); string attribute = element.Attribute("Name"); if (attribute != null) { obj.name = attribute; } attribute = element.Attribute("StartDelayTime"); if (attribute != null) { obj.startDelay = StrParser.ParseFloat(attribute, 0.0f); } attribute = element.Attribute("DelayTime"); if (attribute != null) { obj.delay = StrParser.ParseFloat(attribute, 0.0f); } attribute = element.Attribute("Volume"); if (attribute != null) { obj.volume = StrParser.ParseFloat(attribute, 100.0f); } return(true); }
private bool LoadItemElement(SecurityElement element, out JobPlaceElement itemElement) { itemElement = new JobPlaceElement(); string attribute = element.Attribute("Job_Place_ID"); if (attribute != null) { itemElement.Job_Place_ID = StrParser.ParseDecInt(attribute, -1); } attribute = element.Attribute("Job_Place_Name"); if (attribute != null) { itemElement.Job_Place_Name = StrParser.ParseStr(attribute, ""); } attribute = element.Attribute("Need_Fans"); if (attribute != null) { itemElement.Need_Fans = StrParser.ParseDecInt(attribute, -1); } return(true); }
// <Item Area_ID="1" Citys="1|2|3|4" Populace="1370536875" Publication="1:0.2,2:0.3,3:0.4" Lv_Consume="3" Map_Index="2" Area_Name="中国" Area_Pic=""/> public static Map_AreaObject Load(SecurityElement element) { Map_AreaObject mapareaObject = new Map_AreaObject(); mapareaObject.Area_ID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Area_ID"), ""), -1); // mapareaObject.Citys = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute ("Citys"), ""),-1); string Condition = StrParser.ParseStr(element.Attribute("Citys"), ""); if ("" != Condition && null != Condition) { string[] vecs = Condition.Split('|'); mapareaObject._Citys.Clear(); foreach (string Conditionstring in vecs) { int temp = StrParser.ParseDecInt(Conditionstring, -1); mapareaObject._Citys.Add(temp); } } mapareaObject.Populace = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Populace"), ""), -1); mapareaObject.Publication = StrParser.ParseStr(element.Attribute("Publication"), ""); mapareaObject.Lv_Consume = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Lv_Consume"), ""), -1); mapareaObject.Lv_Populace = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Lv_Populace"), ""), -1); mapareaObject.Map_Index = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Map_Index"), ""), -1); mapareaObject.Area_Name = StrParser.ParseStr(element.Attribute("Area_Name"), ""); mapareaObject.Area_Pic = StrParser.ParseStr(element.Attribute("Area_Pic"), ""); return(mapareaObject); }
public static SeaAreaObject Load(SecurityElement element) { SeaAreaObject seaAreaObject = new SeaAreaObject(); seaAreaObject.SeaAreaID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Sea_ID"), ""), -1); seaAreaObject.SeaAreaNameID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Sea_Name"), ""), -1); seaAreaObject.PortNameID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Port_Name"), ""), -1); seaAreaObject.CopyIdList = StrParser.ParseDecIntList(StrParser.ParseStr(element.Attribute("Copy_List"), ""), -1); seaAreaObject.FlourishValue = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("flourish_Value"), ""), -1); seaAreaObject.FlourishLevel = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("flourish_Level"), ""), -1); seaAreaObject.DefenseValue = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Defense_Value"), ""), -1); seaAreaObject.DefenseLevel = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Defense_Level"), ""), -1); seaAreaObject.SceneName = StrParser.ParseStr(element.Attribute("Port_Map"), ""); seaAreaObject.PortPosition = StrParser.ParseStr(element.Attribute("Port_Pos"), ""); // seaAreaObject.SeaAreaPosition = StrParser.ParseStr(StrParser.ParseStr(element.Attribute("Sea_Pos"), ""),""); seaAreaObject.CountryID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Country_ID"), ""), -1); seaAreaObject.CountryFlagIcon = element.Attribute("Country_Flag_Icon"); seaAreaObject.BuildingIdList = StrParser.ParseDecIntList(StrParser.ParseStr(element.Attribute("Build_ID"), ""), -1); seaAreaObject.CampID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Camp_ID"), ""), -1); seaAreaObject.CampChange = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Camp_Change"), ""), -1); seaAreaObject.AlliesReputation = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Allies_Reputation"), ""), -1); seaAreaObject.AxisReputation = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Axis_Reputation"), ""), -1); seaAreaObject.NeutralReputation = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Neutral_Reputation"), ""), -1); seaAreaObject.WinnerPlayerNameID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Winner_Player_Name"), ""), -1); seaAreaObject.WinnerTime = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Winner_Time"), ""), -1); seaAreaObject.LevelRequire = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Level_Require"), ""), -1); seaAreaObject.FeatRequire = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Feat_Require"), ""), -1); seaAreaObject.TaskRequire = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Task_Require"), ""), -1); seaAreaObject.CampRequire = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Camp_Require"), ""), -1); seaAreaObject.BlueprintSort = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("BluePrints"), ""), 0); return(seaAreaObject); }
private bool LoadChestShowElement(SecurityElement element, out ChestShowElement itemElement) { itemElement = new ChestShowElement(); string attribute = element.Attribute("ID"); if (attribute != null) { itemElement.ID = StrParser.ParseDecInt(attribute, -1); } attribute = element.Attribute("Chest_ID"); if (attribute != null) { itemElement.Chest_ID = StrParser.ParseDecInt(attribute, -1); } attribute = element.Attribute("Show_Item_Type"); if (attribute != null) { itemElement.Show_Item_Type = StrParser.ParseDecInt(attribute, -1); } attribute = element.Attribute("Show_Item_ID"); if (attribute != null) { itemElement.Show_Item_ID = StrParser.ParseDecInt(attribute, -1); } attribute = element.Attribute("Show_Item_Num"); if (attribute != null) { itemElement.Show_Item_Num = StrParser.ParseDecInt(attribute, -1); } return(true); }
private bool LoadItemElement(SecurityElement element, out ConstellationElement itemElement) { itemElement = new ConstellationElement(); string attribute = element.Attribute("Constellation_ID"); if (attribute != null) { itemElement.nID = StrParser.ParseDecInt(attribute, -1); } attribute = element.Attribute("Constellation_Name"); if (attribute != null) { itemElement.StrName = StrParser.ParseStr(attribute, ""); } attribute = element.Attribute("Constellation_Icon"); if (attribute != null) { itemElement.StrIcon = StrParser.ParseStr(attribute, ""); } attribute = element.Attribute("Constellation_Describe"); if (attribute != null) { itemElement.StrDesc = StrParser.ParseStr(attribute, ""); } return(true); }
public bool Load(SecurityElement element) { if (element.Tag != "RootNode") { Debug.Log("ERROR: Element Tag is Wrong"); return(false); } if (element.Children == null) { Debug.Log("ERROR: Child Element is Null"); return(false); } foreach (SecurityElement noodElement in element.Children) { AssetWeigth assetWeigth = new AssetWeigth(); int nodeID = StrParser.ParseDecInt(noodElement.Attribute("ID"), -1); assetWeigth.id = nodeID; foreach (SecurityElement packageElement in noodElement.Children) { string assetName = StrParser.ParseStr(packageElement.Attribute("Name"), ""); int assetValue = StrParser.ParseDecInt(packageElement.Attribute("Value"), -1); assetWeigth.nodePackages.Add(assetName, assetValue); } assetWeigthDict.Add(nodeID, assetWeigth); } return(true); }
private bool LoadItemElement(SecurityElement element, out SystemPropertyObject itemElement) { itemElement = new SystemPropertyObject(); string attribute = element.Attribute("ID"); if (attribute != null) { itemElement.ID = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Conf_Name"); if (attribute != null) { itemElement.Conf_Name = StrParser.ParseStr(attribute, ""); } attribute = element.Attribute("Conf_Value"); if (attribute != null) { itemElement.Conf_Value = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Msg"); if (attribute != null) { itemElement.Msg = StrParser.ParseStr(attribute, ""); } return(true); }
public override bool Load(SecurityElement element) { if (element.Tag != "Items") { return(false); } if (element.Children != null) { foreach (SecurityElement childrenElement in element.Children) { WordStruct currStruct = new WordStruct(); currStruct._wordID = StrParser.ParseDecInt(StrParser.ParseStr(childrenElement.Attribute("ID"), ""), 0); currStruct._wordTextCN = StrParser.ParseStr(childrenElement.Attribute("CN"), ""); currStruct._wordTextEN = StrParser.ParseStr(childrenElement.Attribute("EN"), ""); currStruct._wordTextJP = StrParser.ParseStr(childrenElement.Attribute("JP"), ""); currStruct._wordTextOther = StrParser.ParseStr(childrenElement.Attribute("Other"), ""); _wordDictionary.Add(currStruct._wordID, currStruct); } } else { return(false); } return(true); }
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") { int attributeID = 0; string attributeIcon = ""; string attribute = childrenElement.Attribute("AttributeID"); if (attribute != null) { attributeID = StrParser.ParseDecInt(attribute, -1); } attribute = childrenElement.Attribute("AttributeIcon"); if (attribute != null) { attributeIcon = attribute; } _mItemElementList[attributeID] = attributeIcon; } } return(true); } return(false); }
public static Task_PlayObject Load(SecurityElement element) { Task_PlayObject task_PlayObjectObject = new Task_PlayObject(); task_PlayObjectObject.ID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("ID"), ""), -1); task_PlayObjectObject.Chapter = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Chapter"), ""), -1); task_PlayObjectObject.Chapter_Name = StrParser.ParseStr(element.Attribute("Chapter_Name"), ""); task_PlayObjectObject.CG_Type = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("CG_Type"), ""), -1); string Condition = StrParser.ParseStr(element.Attribute("Task_ID"), ""); if ("" != Condition && null != Condition) { string[] vecs = Condition.Split('|'); task_PlayObjectObject._task_IDList.Clear(); foreach (string Conditionstring in vecs) { int temp = StrParser.ParseDecInt(Conditionstring, -1); task_PlayObjectObject._task_IDList.Add(temp); } } task_PlayObjectObject.Task_Title = StrParser.ParseStr(element.Attribute("Task_Title"), ""); task_PlayObjectObject._is_Feature = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Is_Feature"), ""), -1); task_PlayObjectObject._is_branch = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Is_branch"), ""), -1); // return(task_PlayObjectObject); }
private bool LoadItemElement(SecurityElement element, out Publish_NpcObj itemElement) { itemElement = new Publish_NpcObj(); string attribute = element.Attribute("Publish_ID"); if (attribute != null) { itemElement.Publish_ID = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Type"); if (attribute != null) { itemElement.Type = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Score"); if (attribute != null) { itemElement.Score = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Name"); if (attribute != null) { itemElement.Name = StrParser.ParseStr(attribute, ""); } attribute = element.Attribute("Actors"); if (attribute != null) { itemElement.Actors = StrParser.ParseStr(attribute, ""); } return(true); }
public static Package Load(SecurityElement e) { if (e.Tag != "Package") { return(null); } Package package = new Package(); package._file = StrParser.ParseStr(e.Attribute("File"), ""); package._version = StrParser.ParseDecInt(e.Attribute("Version"), 0); package._createTime = StrParser.ParseDouble(e.Attribute("CreateTime"), 0); if (e.Children != null) { foreach (SecurityElement c in e.Children) { Asset asset = Asset.Load(c); if (asset == null) { continue; } if (!package._assetDict.ContainsKey(asset.File)) { package._assetDict [asset.File] = asset; } } } return(package); }
private bool LoadItemElement(SecurityElement element, out PetSkillConfigObject itemElement) { itemElement = new PetSkillConfigObject(); string attribute = element.Attribute("Pet_Skill_ID"); if (attribute != null) { itemElement.Pet_Skill_ID = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Add_Type"); if (attribute != null) { itemElement.Add_Type = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Add_Num"); if (attribute != null) { itemElement.Add_Num = StrParser.ParseDecInt(attribute, 0); } attribute = element.Attribute("Weight"); if (attribute != null) { itemElement.Weight = StrParser.ParseDecInt(attribute, 0); } return(true); }
/// <summary> /// Create one package. /// </summary> /// <returns> /// The package. /// </returns> public string CreateNewPackage(double createTime) { int packMaxNumber = 0; foreach (Package package in _packageDict.Values) { int packNumber = StrParser.ParseDecInt(package.File, 0); if (packNumber > packMaxNumber) { packMaxNumber = packNumber; } } packMaxNumber++; Package newPackage = new Package(); newPackage.File = packMaxNumber.ToString("D5"); newPackage.Version = 0; newPackage.CreateTime = createTime; _packageDict [newPackage.File] = newPackage; return(newPackage.File); }
public override void Initialize(params object[] parameters) { base.Initialize(parameters); // Create audio listener //audioListener = gameObject.GetComponent<AudioListener>(); //if (audioListener == null) // audioListener = gameObject.AddComponent<AudioListener>(); AudioListener.volume = 1; //从本地配表初始化音效开关状态 string temp = PlayerPrefs.GetString(PlayerSaveData.SaveDataKeys.MusicKey); NeedPlayMusic = string.IsNullOrEmpty(temp) || StrParser.ParseBool(temp); temp = PlayerPrefs.GetString(PlayerSaveData.SaveDataKeys.SoundKey); NeedPlaySound = string.IsNullOrEmpty(temp) || StrParser.ParseBool(temp); NGUITools.EnablePlaySound = NeedPlaySound; LoggerManager.Instance.Info("loading audio lisnter "); var audioLisnter = ResourceManager.Instance.InstantiateAsset <GameObject>(AssetType.Other, "AudioListener", false); LoggerManager.Instance.Info("finish loading audio lisnter " + (audioLisnter == null ? "null" : "success")); GameObject.DontDestroyOnLoad(audioLisnter); // 没有非空判断,死就死吧 audioLisnterTransform = audioLisnter.transform; }
public static FlashObject Load(SecurityElement element) { FlashObject flashObject = new FlashObject(); flashObject.FlashID = StrParser.ParseDecInt(StrParser.ParseStr(element.Attribute("Flash_ID"), ""), -1); flashObject.FlashPrefabName = StrParser.ParseStr(element.Attribute("FlashPrefabName"), ""); return(flashObject); }