Skip to content

Commit

Permalink
Split AudioInstance subclasses into separate files
Browse files Browse the repository at this point in the history
  • Loading branch information
danwilkins committed Jan 15, 2024
1 parent 2c587da commit 0f051c6
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 66 deletions.
67 changes: 1 addition & 66 deletions LanternExtractor/EQ/Sound/AudioInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
22 changes: 22 additions & 0 deletions LanternExtractor/EQ/Sound/MusicInstance.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
19 changes: 19 additions & 0 deletions LanternExtractor/EQ/Sound/SoundInstance.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
18 changes: 18 additions & 0 deletions LanternExtractor/EQ/Sound/SoundInstance2d.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
14 changes: 14 additions & 0 deletions LanternExtractor/EQ/Sound/SoundInstance3d.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
}

0 comments on commit 0f051c6

Please sign in to comment.