private SupportData LoadHelpUnit(Json_Support json) { if (json == null) { return((SupportData)null); } SupportData supportData = new SupportData(); supportData.Deserialize(json); return(supportData); }
public void Deserialize(Json_Support[] json) { this.m_SupportData = new SupportData[json.Length]; for (int index = 0; index < json.Length; ++index) { SupportData supportData = new SupportData(); try { supportData.Deserialize(json[index]); this.m_SupportData[index] = supportData; } catch (Exception ex) { DebugUtility.LogException(ex); } } }
public override void OnSuccess(WWWResult www) { if (Network.IsError) { switch (Network.ErrCode) { case Network.EErrCode.RankingQuestMaintenance: case Network.EErrCode.RankingQuest_OutOfPeriod: Network.RemoveAPI(); ((Behaviour)this).set_enabled(false); this.ActivateOutputLinks(102); break; case Network.EErrCode.RankingQuest_NotNewScore: case Network.EErrCode.RankingQuest_AlreadyEntry: this.OnFailed(); break; default: this.OnRetry(); break; } } else { WebAPI.JSON_BodyResponse <FlowNode_ReqQuestRankingParty.Json> jsonObject = JSONParser.parseJSONObject <WebAPI.JSON_BodyResponse <FlowNode_ReqQuestRankingParty.Json> >(www.text); DebugUtility.Assert(jsonObject != null, "res == null"); if (jsonObject.body == null) { this.OnRetry(); } else { Network.RemoveAPI(); GlobalVars.UserSelectionPartyData selectionPartyData = new GlobalVars.UserSelectionPartyData(); FlowNode_ReqQuestRankingParty.Json body = jsonObject.body; if (body.party != null) { UnitData[] unitDataArray = new UnitData[((IEnumerable <Json_Unit>)body.party).Count <Json_Unit>((Func <Json_Unit, bool>)(j => j != null))]; for (int index = 0; index < unitDataArray.Length; ++index) { if (body.party[index] == null || string.IsNullOrEmpty(body.party[index].iname)) { unitDataArray[index] = (UnitData)null; } else { unitDataArray[index] = new UnitData(); unitDataArray[index].Deserialize(body.party[index]); } } selectionPartyData.unitData = unitDataArray; } if (body.items != null) { ItemData[] itemDataArray = new ItemData[body.items.Length]; for (int index = 0; index < itemDataArray.Length; ++index) { itemDataArray[index] = new ItemData(); itemDataArray[index].Setup(0L, body.items[index].iname, body.items[index].num); } selectionPartyData.usedItems = itemDataArray; } if (body.help != null) { SupportData supportData = new SupportData(); supportData.Deserialize(body.help); selectionPartyData.supportData = supportData; } selectionPartyData.achievements = new int[0]; GlobalVars.UserSelectionPartyDataInfo = selectionPartyData; this.Success(); } } }