mirror of
				https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
				synced 2025-11-04 03:55:52 +01:00 
			
		
		
		
	Merge branch 'logic' of https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02 into logic
This commit is contained in:
		@@ -1,26 +1,25 @@
 | 
			
		||||
////////////////////////////////////////
 | 
			
		||||
// Programming project code
 | 
			
		||||
// UniBw M, 2022, 2023, 2024
 | 
			
		||||
// www.unibw.de/inf2
 | 
			
		||||
// (c) Mark Minas (mark.minas@unibw.de)
 | 
			
		||||
////////////////////////////////////////
 | 
			
		||||
 | 
			
		||||
package pp.monopoly.notification;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Event when an item is added to a map.
 | 
			
		||||
 * Event when a sound needs to be played.
 | 
			
		||||
 *
 | 
			
		||||
 * @param sound the sound to be played
 | 
			
		||||
 * @param soundFileName the sound file to be played
 | 
			
		||||
 */
 | 
			
		||||
public record SoundEvent(Sound sound) implements GameEvent {
 | 
			
		||||
public class SoundEvent implements GameEvent {
 | 
			
		||||
    private final String soundFileName;
 | 
			
		||||
 | 
			
		||||
    public SoundEvent(Sound sound) {
 | 
			
		||||
        this.soundFileName = sound.getFileName(); // Angenommen, Sound hat eine Methode getFileName()
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getSoundFileName() {
 | 
			
		||||
        return soundFileName;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Notifies the game event listener of this event.
 | 
			
		||||
     *
 | 
			
		||||
     * @param listener the game event listener
 | 
			
		||||
     */
 | 
			
		||||
    @Override
 | 
			
		||||
    public void notifyListener(GameEventListener listener) {
 | 
			
		||||
        listener.receivedEvent(this);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user