public override void Deserialize(ICustomDataInput reader) { Duration = reader.ReadInt(); RewardRate = reader.ReadVarShort(); LootShareLimitMalus = reader.ReadShort(); var countResults = reader.ReadShort(); Results = new List <FightResultListEntry>(); for (short i = 0; i < countResults; i++) { var resultstypeId = reader.ReadShort(); FightResultListEntry type = new FightResultListEntry(); type.Deserialize(reader); Results.Add(type); } var countNamedPartyTeamsOutcomes = reader.ReadShort(); NamedPartyTeamsOutcomes = new List <NamedPartyTeamWithOutcome>(); for (short i = 0; i < countNamedPartyTeamsOutcomes; i++) { NamedPartyTeamWithOutcome type = new NamedPartyTeamWithOutcome(); type.Deserialize(reader); NamedPartyTeamsOutcomes.Add(type); } }
public override void Deserialize(IDataReader reader) { this.duration = (uint)reader.ReadInt(); if (this.duration < 0U) { throw new Exception("Forbidden value (" + (object)this.duration + ") on element of GameFightEndMessage.duration."); } this.rewardRate = (int)reader.ReadVarShort(); this.lootShareLimitMalus = (int)reader.ReadShort(); uint num1 = (uint)reader.ReadUShort(); for (int index = 0; (long)index < (long)num1; ++index) { FightResultListEntry instance = ProtocolTypeManager.GetInstance <FightResultListEntry>((uint)reader.ReadUShort()); instance.Deserialize(reader); this.results.Add(instance); } uint num2 = (uint)reader.ReadUShort(); for (int index = 0; (long)index < (long)num2; ++index) { NamedPartyTeamWithOutcome partyTeamWithOutcome = new NamedPartyTeamWithOutcome(); partyTeamWithOutcome.Deserialize(reader); this.namedPartyTeamsOutcomes.Add(partyTeamWithOutcome); } }
public override void Deserialize(ICustomDataInput reader) { m_duration = reader.ReadInt(); m_ageBonus = reader.ReadShort(); m_lootShareLimitMalus = reader.ReadShort(); int resultsCount = reader.ReadUShort(); int resultsIndex; m_results = new System.Collections.Generic.List <FightResultListEntry>(); for (resultsIndex = 0; (resultsIndex < resultsCount); resultsIndex = (resultsIndex + 1)) { FightResultListEntry objectToAdd = ProtocolTypeManager.GetInstance <FightResultListEntry>((short)reader.ReadUShort()); objectToAdd.Deserialize(reader); m_results.Add(objectToAdd); } int namedPartyTeamsOutcomesCount = reader.ReadUShort(); int namedPartyTeamsOutcomesIndex; m_namedPartyTeamsOutcomes = new System.Collections.Generic.List <NamedPartyTeamWithOutcome>(); for (namedPartyTeamsOutcomesIndex = 0; (namedPartyTeamsOutcomesIndex < namedPartyTeamsOutcomesCount); namedPartyTeamsOutcomesIndex = (namedPartyTeamsOutcomesIndex + 1)) { NamedPartyTeamWithOutcome objectToAdd = new NamedPartyTeamWithOutcome(); objectToAdd.Deserialize(reader); m_namedPartyTeamsOutcomes.Add(objectToAdd); } }
public void Deserialize(IDataReader reader) { Duration = (UInt32)reader.ReadInt(); AgeBonus = reader.ReadShort(); LootShareLimitMalus = reader.ReadShort(); Results = new FightResultListEntry[reader.ReadShort()]; for (var i = 0; i < Results.Length; i++) { (Results[i] = new FightResultListEntry()).Deserialize(reader); } NamedPartyTeamsOutcomes = new NamedPartyTeamWithOutcome[reader.ReadShort()]; for (var i = 0; i < NamedPartyTeamsOutcomes.Length; i++) { (NamedPartyTeamsOutcomes[i] = new NamedPartyTeamWithOutcome()).Deserialize(reader); } }
public override void Serialize(IDataWriter writer) { writer.WriteShort(((short)(m_results.Count))); int resultsIndex; for (resultsIndex = 0; (resultsIndex < m_results.Count); resultsIndex = (resultsIndex + 1)) { FightResultListEntry objectToSend = m_results[resultsIndex]; writer.WriteUShort(((ushort)(objectToSend.TypeID))); objectToSend.Serialize(writer); } writer.WriteShort(((short)(m_namedPartyTeamsOutcomes.Count))); int namedPartyTeamsOutcomesIndex; for (namedPartyTeamsOutcomesIndex = 0; (namedPartyTeamsOutcomesIndex < m_namedPartyTeamsOutcomes.Count); namedPartyTeamsOutcomesIndex = (namedPartyTeamsOutcomesIndex + 1)) { NamedPartyTeamWithOutcome objectToSend = m_namedPartyTeamsOutcomes[namedPartyTeamsOutcomesIndex]; objectToSend.Serialize(writer); } writer.WriteInt(m_duration); writer.WriteShort(m_ageBonus); writer.WriteShort(m_lootShareLimitMalus); }
public override void Deserialize(IDataReader reader) { Duration = reader.ReadInt(); RewardRate = reader.ReadVarShort(); LootShareLimitMalus = reader.ReadShort(); var ResultsCount = reader.ReadShort(); Results = new List <FightResultListEntry>(); for (var i = 0; i < ResultsCount; i++) { FightResultListEntry objectToAdd = ProtocolTypeManager.GetInstance(reader.ReadUShort()); objectToAdd.Deserialize(reader); Results.Add(objectToAdd); } var NamedPartyTeamsOutcomesCount = reader.ReadShort(); NamedPartyTeamsOutcomes = new List <NamedPartyTeamWithOutcome>(); for (var i = 0; i < NamedPartyTeamsOutcomesCount; i++) { var objectToAdd = new NamedPartyTeamWithOutcome(); objectToAdd.Deserialize(reader); NamedPartyTeamsOutcomes.Add(objectToAdd); } }
public override void Deserialize(IDataReader reader) { Duration = reader.ReadInt(); AgeBonus = reader.ReadShort(); LootShareLimitMalus = reader.ReadShort(); var resultsCount = reader.ReadUShort(); Results = new List <FightResultListEntry>(); for (var resultsIndex = 0; resultsIndex < resultsCount; resultsIndex++) { var objectToAdd = ProtocolTypeManager.GetInstance <FightResultListEntry>(reader.ReadUShort()); objectToAdd.Deserialize(reader); Results.Add(objectToAdd); } var namedPartyTeamsOutcomesCount = reader.ReadUShort(); NamedPartyTeamsOutcomes = new List <NamedPartyTeamWithOutcome>(); for (var namedPartyTeamsOutcomesIndex = 0; namedPartyTeamsOutcomesIndex < namedPartyTeamsOutcomesCount; namedPartyTeamsOutcomesIndex++) { var objectToAdd = new NamedPartyTeamWithOutcome(); objectToAdd.Deserialize(reader); NamedPartyTeamsOutcomes.Add(objectToAdd); } }