public static void initReaders() { if (readers == null) { readers = new Dictionary <Type, Func <BinaryReader, dynamic> >(); readers.Add(typeof(byte), r => r.ReadByte()); readers.Add(typeof(ushort), r => r.ReadUInt16()); readers.Add(typeof(short), r => r.ReadInt16()); readers.Add(typeof(uint), r => r.ReadUInt32()); readers.Add(typeof(int), r => r.ReadInt32()); readers.Add(typeof(ulong), r => r.ReadUInt64()); readers.Add(typeof(long), r => r.ReadInt64()); readers.Add(typeof(float), r => r.ReadSingle()); readers.Add(typeof(double), r => r.ReadDouble()); readers.Add(typeof(PStringChar), r => PStringChar.read(r)); readers.Add(typeof(STypeInt), r => (STypeInt)r.ReadUInt32()); readers.Add(typeof(STypeInt64), r => (STypeInt64)r.ReadUInt32()); readers.Add(typeof(STypeBool), r => (STypeBool)r.ReadUInt32()); readers.Add(typeof(STypeFloat), r => (STypeFloat)r.ReadUInt32()); readers.Add(typeof(STypeString), r => (STypeString)r.ReadUInt32()); readers.Add(typeof(STypeDID), r => (STypeDID)r.ReadUInt32()); readers.Add(typeof(STypePosition), r => (STypePosition)r.ReadUInt32()); readers.Add(typeof(STypeIID), r => (STypeIID)r.ReadUInt32()); readers.Add(typeof(STypeSkill), r => (STypeSkill)r.ReadUInt32()); //readers.Add(typeof(CharacterTitle), r => (CharacterTitle)r.ReadUInt32()); //readers.Add(typeof(SKILL_ADVANCEMENT_CLASS), r => (SKILL_ADVANCEMENT_CLASS)r.ReadUInt32()); readers.Add(typeof(CM_Magic.Enchantment), r => CM_Magic.Enchantment.read(r)); readers.Add(typeof(CM_Magic.EnchantmentID), r => CM_Magic.EnchantmentID.read(r)); //readers.Add(typeof(CM_Social.FriendData), r => CM_Social.FriendData.read(r)); //readers.Add(typeof(CM_Social.CContractTracker), r => CM_Social.CContractTracker.read(r)); readers.Add(typeof(Attribute), r => Attribute.read(r)); readers.Add(typeof(SecondaryAttribute), r => SecondaryAttribute.read(r)); readers.Add(typeof(Position), r => Position.read(r)); readers.Add(typeof(Skill), r => Skill.read(r)); readers.Add(typeof(SpellID), r => (SpellID)r.ReadUInt32()); //readers.Add(typeof(CM_Vendor.ItemProfile), r => CM_Vendor.ItemProfile.read(r)); //readers.Add(typeof(CM_Fellowship.Fellow), r => CM_Fellowship.Fellow.read(r)); //readers.Add(typeof(CM_Fellowship.LockedFellowshipList), r => CM_Fellowship.LockedFellowshipList.read(r)); readers.Add(typeof(CM_Inventory.ContentProfile), r => CM_Inventory.ContentProfile.read(r)); readers.Add(typeof(CM_Login.InventoryPlacement), r => CM_Login.InventoryPlacement.read(r)); //readers.Add(typeof(CM_Login.MissingIteration), r => CM_Login.MissingIteration.read(r)); //readers.Add(typeof(CM_Login.CAllIterationList), r => CM_Login.CAllIterationList.read(r)); //readers.Add(typeof(CM_Login.PTaggedIterationList), r => CM_Login.PTaggedIterationList.read(r)); //readers.Add(typeof(CM_Login.CMostlyConsecutiveIntSet), r => CM_Login.CMostlyConsecutiveIntSet.read(r)); //readers.Add(typeof(CM_House.HousePayment), r => CM_House.HousePayment.read(r)); //readers.Add(typeof(CM_Inventory.SalvageResult), r => CM_Inventory.SalvageResult.read(r)); //readers.Add(typeof(CM_Writing.PageData), r => CM_Writing.PageData.read(r)); } }
public static AttributeCache read(BinaryReader binaryReader) { AttributeCache newObj = new AttributeCache(); newObj.header = binaryReader.ReadUInt32(); newObj._strength = Attribute.read(binaryReader); newObj._endurance = Attribute.read(binaryReader); newObj._quickness = Attribute.read(binaryReader); newObj._coordination = Attribute.read(binaryReader); newObj._focus = Attribute.read(binaryReader); newObj._self = Attribute.read(binaryReader); newObj._health = SecondaryAttribute.read(binaryReader); newObj._stamina = SecondaryAttribute.read(binaryReader); newObj._mana = SecondaryAttribute.read(binaryReader); return(newObj); }
public static void initReaders() { if (readers == null) { readers = new Dictionary <Type, Func <BinaryReader, dynamic> >(); readers.Add(typeof(byte), r => r.ReadByte()); readers.Add(typeof(ushort), r => r.ReadUInt16()); readers.Add(typeof(short), r => r.ReadInt16()); readers.Add(typeof(uint), r => r.ReadUInt32()); readers.Add(typeof(int), r => r.ReadInt32()); readers.Add(typeof(ulong), r => r.ReadUInt64()); readers.Add(typeof(long), r => r.ReadInt64()); readers.Add(typeof(float), r => r.ReadSingle()); readers.Add(typeof(double), r => r.ReadDouble()); readers.Add(typeof(PStringChar), r => PStringChar.read(r)); readers.Add(typeof(STypeInt), r => (STypeInt)r.ReadUInt32()); readers.Add(typeof(STypeInt64), r => (STypeInt64)r.ReadUInt32()); readers.Add(typeof(STypeBool), r => (STypeBool)r.ReadUInt32()); readers.Add(typeof(STypeFloat), r => (STypeFloat)r.ReadUInt32()); readers.Add(typeof(STypeString), r => (STypeString)r.ReadUInt32()); readers.Add(typeof(STypeDID), r => (STypeDID)r.ReadUInt32()); readers.Add(typeof(STypePosition), r => (STypePosition)r.ReadUInt32()); readers.Add(typeof(STypeIID), r => (STypeIID)r.ReadUInt32()); readers.Add(typeof(STypeSkill), r => (STypeSkill)r.ReadUInt32()); readers.Add(typeof(CharacterTitle), r => (CharacterTitle)r.ReadUInt32()); readers.Add(typeof(SKILL_ADVANCEMENT_CLASS), r => (SKILL_ADVANCEMENT_CLASS)r.ReadUInt32()); readers.Add(typeof(CM_Magic.Enchantment), r => CM_Magic.Enchantment.read(r)); readers.Add(typeof(CM_Social.FriendData), r => CM_Social.FriendData.read(r)); readers.Add(typeof(Attribute), r => Attribute.read(r)); readers.Add(typeof(SecondaryAttribute), r => SecondaryAttribute.read(r)); readers.Add(typeof(Position), r => Position.read(r)); readers.Add(typeof(Skill), r => Skill.read(r)); readers.Add(typeof(SpellID), r => (SpellID)r.ReadUInt32()); readers.Add(typeof(CM_Vendor.ItemProfile), r => CM_Vendor.ItemProfile.read(r)); } }