From 0f051c61833fcbece79f369e889de55502a7fdd3 Mon Sep 17 00:00:00 2001 From: Daniel Wilkins Date: Mon, 15 Jan 2024 14:29:50 -0800 Subject: [PATCH] Split AudioInstance subclasses into separate files --- LanternExtractor/EQ/Sound/AudioInstance.cs | 67 +------------------- LanternExtractor/EQ/Sound/MusicInstance.cs | 22 +++++++ LanternExtractor/EQ/Sound/SoundInstance.cs | 19 ++++++ LanternExtractor/EQ/Sound/SoundInstance2d.cs | 18 ++++++ LanternExtractor/EQ/Sound/SoundInstance3d.cs | 14 ++++ 5 files changed, 74 insertions(+), 66 deletions(-) create mode 100644 LanternExtractor/EQ/Sound/MusicInstance.cs create mode 100644 LanternExtractor/EQ/Sound/SoundInstance.cs create mode 100644 LanternExtractor/EQ/Sound/SoundInstance2d.cs create mode 100644 LanternExtractor/EQ/Sound/SoundInstance3d.cs diff --git a/LanternExtractor/EQ/Sound/AudioInstance.cs b/LanternExtractor/EQ/Sound/AudioInstance.cs index 7b1bbd8..cd8d664 100644 --- a/LanternExtractor/EQ/Sound/AudioInstance.cs +++ b/LanternExtractor/EQ/Sound/AudioInstance.cs @@ -17,69 +17,4 @@ protected AudioInstance(AudioType type, float posX, float posY, float posZ, floa public float PosZ { get; } public float Radius { get; } } - - public class MusicInstance : AudioInstance - { - public MusicInstance(AudioType type, float posX, float posY, float posZ, float radius, int trackIndexDay, - int trackIndexNight, int loopCountDay, int loopCountNight, int fadeOutMs) : base(type, posX, posY, posZ, - radius) - { - TrackIndexDay = trackIndexDay; - TrackIndexNight = trackIndexNight; - LoopCountDay = loopCountDay; - LoopCountNight = loopCountNight; - FadeOutMs = fadeOutMs; - } - - public int TrackIndexDay { get; } - public int TrackIndexNight { get; } - public int LoopCountDay { get; } - public int LoopCountNight { get; } - public int FadeOutMs { get; } - } - - public abstract class SoundInstance : AudioInstance - { - public string Sound1 { get; } - public float Volume1 { get; } - public int Cooldown1 { get; } - public int CooldownRandom { get; } - - protected SoundInstance(AudioType type, float posX, float posY, float posZ, float radius, float volume1, - string sound1, int cooldown1, int cooldownRandom) : base(type, posX, posY, posZ, radius) - { - Sound1 = sound1; - Volume1 = volume1; - Cooldown1 = cooldown1; - CooldownRandom = cooldownRandom; - } - } - - public class SoundInstance2d : SoundInstance - { - public string Sound2 { get; } - public float Volume2 { get; } - public int Cooldown2 { get; } - - public SoundInstance2d(AudioType type, float posX, float posY, float posZ, float radius, float volume1, - string sound1, int cooldown1, string sound2, int cooldown2, int cooldownRandom, float volume2) : base(type, posX, posY, posZ, radius, volume1, - sound1, cooldown1, cooldownRandom) - { - Sound2 = sound2; - Cooldown2 = cooldown2; - Volume2 = volume2; - } - } - - public class SoundInstance3d : SoundInstance - { - public int Multiplier; - - public SoundInstance3d(AudioType type, float posX, float posY, float posZ, float radius, float volume, - string sound1, int cooldown1, int cooldownRandom, int multiplier) : base(type, posX, posY, posZ, radius, volume, sound1, - cooldown1, cooldownRandom) - { - Multiplier = multiplier; - } - } -} \ No newline at end of file +} diff --git a/LanternExtractor/EQ/Sound/MusicInstance.cs b/LanternExtractor/EQ/Sound/MusicInstance.cs new file mode 100644 index 0000000..0e5411f --- /dev/null +++ b/LanternExtractor/EQ/Sound/MusicInstance.cs @@ -0,0 +1,22 @@ +namespace LanternExtractor.EQ.Sound +{ + public class MusicInstance : AudioInstance + { + public MusicInstance(AudioType type, float posX, float posY, float posZ, float radius, int trackIndexDay, + int trackIndexNight, int loopCountDay, int loopCountNight, int fadeOutMs) : base(type, posX, posY, posZ, + radius) + { + TrackIndexDay = trackIndexDay; + TrackIndexNight = trackIndexNight; + LoopCountDay = loopCountDay; + LoopCountNight = loopCountNight; + FadeOutMs = fadeOutMs; + } + + public int TrackIndexDay { get; } + public int TrackIndexNight { get; } + public int LoopCountDay { get; } + public int LoopCountNight { get; } + public int FadeOutMs { get; } + } +} diff --git a/LanternExtractor/EQ/Sound/SoundInstance.cs b/LanternExtractor/EQ/Sound/SoundInstance.cs new file mode 100644 index 0000000..f05a1cb --- /dev/null +++ b/LanternExtractor/EQ/Sound/SoundInstance.cs @@ -0,0 +1,19 @@ +namespace LanternExtractor.EQ.Sound +{ + public abstract class SoundInstance : AudioInstance + { + public string Sound1 { get; } + public float Volume1 { get; } + public int Cooldown1 { get; } + public int CooldownRandom { get; } + + protected SoundInstance(AudioType type, float posX, float posY, float posZ, float radius, float volume1, + string sound1, int cooldown1, int cooldownRandom) : base(type, posX, posY, posZ, radius) + { + Sound1 = sound1; + Volume1 = volume1; + Cooldown1 = cooldown1; + CooldownRandom = cooldownRandom; + } + } +} diff --git a/LanternExtractor/EQ/Sound/SoundInstance2d.cs b/LanternExtractor/EQ/Sound/SoundInstance2d.cs new file mode 100644 index 0000000..fe2db15 --- /dev/null +++ b/LanternExtractor/EQ/Sound/SoundInstance2d.cs @@ -0,0 +1,18 @@ +namespace LanternExtractor.EQ.Sound +{ + public class SoundInstance2d : SoundInstance + { + public string Sound2 { get; } + public float Volume2 { get; } + public int Cooldown2 { get; } + + public SoundInstance2d(AudioType type, float posX, float posY, float posZ, float radius, float volume1, + string sound1, int cooldown1, string sound2, int cooldown2, int cooldownRandom, float volume2) : base(type, posX, posY, posZ, radius, volume1, + sound1, cooldown1, cooldownRandom) + { + Sound2 = sound2; + Cooldown2 = cooldown2; + Volume2 = volume2; + } + } +} diff --git a/LanternExtractor/EQ/Sound/SoundInstance3d.cs b/LanternExtractor/EQ/Sound/SoundInstance3d.cs new file mode 100644 index 0000000..0cc9f82 --- /dev/null +++ b/LanternExtractor/EQ/Sound/SoundInstance3d.cs @@ -0,0 +1,14 @@ +namespace LanternExtractor.EQ.Sound +{ + public class SoundInstance3d : SoundInstance + { + public int Multiplier; + + public SoundInstance3d(AudioType type, float posX, float posY, float posZ, float radius, float volume, + string sound1, int cooldown1, int cooldownRandom, int multiplier) : base(type, posX, posY, posZ, radius, volume, sound1, + cooldown1, cooldownRandom) + { + Multiplier = multiplier; + } + } +}