public void Read (TProtocol iprot) { TField field; iprot.ReadStructBegin(); while (true) { field = iprot.ReadFieldBegin(); if (field.Type == TType.Stop) { break; } switch (field.ID) { case 1: if (field.Type == TType.Map) { { RaidTmpls = new Dictionary<int, RaidTemplate>(); TMap _map4 = iprot.ReadMapBegin(); for( int _i5 = 0; _i5 < _map4.Count; ++_i5) { int _key6; RaidTemplate _val7; _key6 = iprot.ReadI32(); _val7 = new RaidTemplate(); _val7.Read(iprot); RaidTmpls[_key6] = _val7; } iprot.ReadMapEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 2: if (field.Type == TType.Map) { { RaidStageTmpls = new Dictionary<int, RaidStageTemplate>(); TMap _map8 = iprot.ReadMapBegin(); for( int _i9 = 0; _i9 < _map8.Count; ++_i9) { int _key10; RaidStageTemplate _val11; _key10 = iprot.ReadI32(); _val11 = new RaidStageTemplate(); _val11.Read(iprot); RaidStageTmpls[_key10] = _val11; } iprot.ReadMapEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; case 3: if (field.Type == TType.Map) { { RaidMonsterGroupTmpls = new Dictionary<int, RaidMonsterGroupTemplate>(); TMap _map12 = iprot.ReadMapBegin(); for( int _i13 = 0; _i13 < _map12.Count; ++_i13) { int _key14; RaidMonsterGroupTemplate _val15; _key14 = iprot.ReadI32(); _val15 = new RaidMonsterGroupTemplate(); _val15.Read(iprot); RaidMonsterGroupTmpls[_key14] = _val15; } iprot.ReadMapEnd(); } } else { TProtocolUtil.Skip(iprot, field.Type); } break; default: TProtocolUtil.Skip(iprot, field.Type); break; } iprot.ReadFieldEnd(); } iprot.ReadStructEnd(); }
public RaidStageTemplate GetNextStage() { var raids = MissionModelLocator.Instance.GetCurrentRaids(); //int raidtemplateid = MissionModelLocator.Instance.CurrRaidType * 100 + int.Parse(themap.id); List<RaidStageInfo> currStages = null; //List<RaidStageInfo> nextStages = null; RaidInfo nextRaidInfo = null; for (int i = 0; i < raids.Count; i++) { if (raids[i].TemplateId == BattleRaidTemplate.Id) { currStages = raids[i].StateInfo; } if (raids[i].TemplateId == BattleRaidTemplate.Id + 1) { //nextStages = raids[i].StateInfo; nextRaidInfo = raids[i]; } } if (currStages != null) { for (int i = 0; i < currStages.Count; i++) { if (currStages[i].TemplateId == BattleStageTemplate.Id + 1) { NextRaidTemplate = BattleRaidTemplate; NextStageTemplate = GetRaidStagrByTemplateId(currStages[i].TemplateId); return NextStageTemplate; } } } var k = 10000000; RaidStageInfo stageinfo = null; if (nextRaidInfo != null && nextRaidInfo.StateInfo != null) { NextRaidTemplate = GetRaidByTemplateId(nextRaidInfo.TemplateId); for (int i = 0; i < nextRaidInfo.StateInfo.Count; i++) { if (k > nextRaidInfo.StateInfo[i].TemplateId) { k = nextRaidInfo.StateInfo[i].TemplateId; stageinfo = nextRaidInfo.StateInfo[i]; } } } if (stageinfo != null) { NextStageTemplate = GetRaidStagrByTemplateId(k); return NextStageTemplate; } NextStageTemplate = null; return null; }