public TerrainLiquidInstance(byte[] data) { using (MemoryStream ms = new MemoryStream(data)) { using (BinaryReader br = new BinaryReader(ms)) { this.LiquidType = new UInt16ForeignKey("LiquidType", "ID", br.ReadUInt16()); this.LiquidObject = new UInt16ForeignKey("LiquidObject", "ID", br.ReadUInt16()); this.HeightLevelRange = new Range(br.ReadSingle(), br.ReadSingle()); this.XLiquidOffset = br.ReadByte(); this.YLiquidOffset = br.ReadByte(); this.Width = br.ReadByte(); this.Height = br.ReadByte(); this.LiquidBooleanMapOffset = br.ReadUInt32(); this.VertexDataOffset = br.ReadUInt32(); // TODO: Read boolean map // TODO: [#9] Accept DBC liquid type and read vertex data } } }
public TextureLayerEntry(byte[] data) { using (MemoryStream ms = new MemoryStream(data)) { using (BinaryReader br = new BinaryReader(ms)) { this.TextureID = br.ReadUInt32(); this.Flags = (TextureLayerFlags)br.ReadUInt32(); this.AlphaMapOffset = br.ReadUInt32(); this.EffectID = new UInt16ForeignKey("GroundEffectTexture", "ID", br.ReadUInt16()); } } }