Removed ResourceManager from AudioManagers

This commit is contained in:
lieght
2025-10-13 02:47:34 +02:00
parent fcc0b9d0dd
commit 4bcf70d4dc
4 changed files with 33 additions and 19 deletions

View File

@@ -6,10 +6,12 @@ import org.toop.framework.networking.NetworkingClientManager;
import org.toop.framework.networking.NetworkingInitializationException;
import org.toop.framework.resource.ResourceLoader;
import org.toop.framework.resource.ResourceManager;
import org.toop.framework.resource.ResourceMeta;
import org.toop.framework.resource.resources.MusicAsset;
import org.toop.framework.resource.resources.SoundEffectAsset;
import java.util.Arrays;
import java.util.List;
public final class Main {
static void main(String[] args) {
@@ -21,17 +23,20 @@ public final class Main {
ResourceManager.loadAssets(new ResourceLoader("app/src/main/resources/assets"));
new Thread(NetworkingClientManager::new).start();
new Thread(() -> {
MusicManager<MusicAsset> musicManager = new MusicManager<>(MusicAsset.class);
SoundEffectManager<SoundEffectAsset> soundEffectManager = new SoundEffectManager<>(SoundEffectAsset.class);
new AudioEventListener<>(
musicManager,
soundEffectManager,
new AudioVolumeManager()
.registerManager(VolumeControl.MASTERVOLUME, musicManager)
.registerManager(VolumeControl.MASTERVOLUME, soundEffectManager)
.registerManager(VolumeControl.FX, soundEffectManager)
.registerManager(VolumeControl.MUSIC, musicManager)
).initListeners("medium-button-click.wav");
MusicManager<MusicAsset> musicManager = new MusicManager<>(ResourceManager.getAllOfTypeAndRemoveWrapper(MusicAsset.class));
SoundEffectManager<SoundEffectAsset> soundEffectManager = new SoundEffectManager<>(ResourceManager.getAllOfType(SoundEffectAsset.class));
AudioVolumeManager audioVolumeManager = new AudioVolumeManager()
.registerManager(VolumeControl.MASTERVOLUME, musicManager)
.registerManager(VolumeControl.MASTERVOLUME, soundEffectManager)
.registerManager(VolumeControl.FX, soundEffectManager)
.registerManager(VolumeControl.MUSIC, musicManager);
new AudioEventListener<>(
musicManager,
soundEffectManager,
audioVolumeManager
).initListeners("medium-button-click.wav");
}).start();
}
}