From 864005e4bc310451e7177f2d1384f7f55feaae5d Mon Sep 17 00:00:00 2001 From: fallenoak Date: Mon, 15 Jan 2024 14:16:27 -0600 Subject: [PATCH] feat(clientdb): add SoundEntriesRecord --- src/lib/clientdb/record/SoundEntriesRecord.ts | 39 +++++++++++++++++++ src/lib/clientdb/records.ts | 1 + 2 files changed, 40 insertions(+) create mode 100644 src/lib/clientdb/record/SoundEntriesRecord.ts diff --git a/src/lib/clientdb/record/SoundEntriesRecord.ts b/src/lib/clientdb/record/SoundEntriesRecord.ts new file mode 100644 index 0000000..9ececdb --- /dev/null +++ b/src/lib/clientdb/record/SoundEntriesRecord.ts @@ -0,0 +1,39 @@ +import * as io from '@wowserhq/io'; +import ClientDbRecord from '../ClientDbRecord.js'; +import * as dbIo from '../io.js'; + +const recordIo = io.struct({ + id: io.int32le, + soundType: io.int32le, + name: dbIo.string, + file: io.array(dbIo.string, { size: 10 }), + freq: io.array(io.int32le, { size: 10 }), + directoryBase: dbIo.string, + volumeFloat: io.float32le, + flags: io.int32le, + minDistance: io.float32le, + distanceCutoff: io.float32le, + eaxdef: io.int32le, + soundEntriesAdvancedId: io.int32le, +}); + +class SoundEntriesRecord extends ClientDbRecord { + soundType: number; + name: string; + file: string[]; + freq: number[]; + directoryBase: string; + volumeFloat: number; + flags: number; + minDistance: number; + distanceCutoff: number; + eaxdef: number; + soundEntriesAdvancedId: number; + + constructor() { + super(recordIo); + } +} + +export default SoundEntriesRecord; +export { SoundEntriesRecord }; diff --git a/src/lib/clientdb/records.ts b/src/lib/clientdb/records.ts index 19f5d7f..3ce5277 100644 --- a/src/lib/clientdb/records.ts +++ b/src/lib/clientdb/records.ts @@ -3,4 +3,5 @@ export * from './record/LightRecord.js'; export * from './record/LightFloatBandRecord.js'; export * from './record/LightIntBandRecord.js'; export * from './record/LightParamsRecord.js'; +export * from './record/SoundEntriesRecord.js'; export * from './record/ZoneMusicRecord.js';