public virtual void Read(BinaryReader reader, int buffVersion, Dictionary <ushort, StatModifier> idTable) { timer = BuffTimer.Read(reader); descriptor = BuffDescriptor.Read(reader); isOverriden = new Value <bool>(reader.ReadBoolean()); int statModifierListCount = reader.ReadByte(); statModifierList = new List <StatModifier>(); for (int i = 0; i < statModifierListCount; i++) { ushort key = reader.ReadUInt16(); StatModifier statModifier = idTable[key]; statModifierList.Add(statModifier); } int buffModiferListCount = reader.ReadByte(); buffModifierList = new List <BuffModifier>(); for (int j = 0; j < buffModiferListCount; j++) { BuffModifier buffModifier = BuffModifier.Read(reader); buffModifier.buff = this; buffModifierList.Add(buffModifier); } instigatorId = new Value <int>(reader.ReadInt32()); }
public static BuffDescriptor Read(BinaryReader reader) { buffDescriptorVersion = new Value <int>(reader.ReadInt32()); BuffDescriptor buffDescriptor = new BuffDescriptor { categoryFlags = (EnumBuffCategoryFlags)reader.ReadInt32(), notificationClass = reader.ReadString() }; // int overrideCount = reader.ReadInt32(); buffDescriptor.overrides = new HashSet <string>(); for (int i = 0; i < overrideCount; ++i) { buffDescriptor.overrides.Add(reader.ReadString()); } return(buffDescriptor); }