00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 package com.realtime.crossfire.jxclient.sound;
00023
00024 import com.realtime.crossfire.jxclient.server.crossfire.CrossfireServerConnection;
00025 import com.realtime.crossfire.jxclient.server.crossfire.CrossfireSoundListener;
00026 import org.jetbrains.annotations.NotNull;
00027
00033 public class SoundWatcher {
00034
00038 @NotNull
00039 private final SoundManager soundManager;
00040
00044 @NotNull
00045 private final CrossfireSoundListener crossfireSoundListener = new CrossfireSoundListener() {
00046
00047 @Override
00048 public void commandSoundReceived(final int x, final int y, final int num, final int type) {
00049
00050 }
00051
00052 @Override
00053 public void commandSound2Received(final int x, final int y, final int dir, final int volume, final int type, @NotNull final String action, @NotNull final String name) {
00054 soundManager.playClip(Sounds.CHARACTER, name, action);
00055 }
00056
00057 };
00058
00064 public SoundWatcher(@NotNull final CrossfireServerConnection crossfireServerConnection, @NotNull final SoundManager soundManager) {
00065 crossfireServerConnection.addCrossfireSoundListener(crossfireSoundListener);
00066 this.soundManager = soundManager;
00067 }
00068
00069 }