Passing a mark will now play a sound. Currently using placeholder sound so will ned to change. #story[1195]
This commit is contained in:
+5
@@ -1,5 +1,6 @@
|
|||||||
package visualiser.Commands.VisualiserRaceCommands;
|
package visualiser.Commands.VisualiserRaceCommands;
|
||||||
|
|
||||||
|
import javafx.scene.media.AudioClip;
|
||||||
import mock.model.commandFactory.Command;
|
import mock.model.commandFactory.Command;
|
||||||
import network.Messages.BoatStatus;
|
import network.Messages.BoatStatus;
|
||||||
import network.Messages.Enums.BoatStatusEnum;
|
import network.Messages.Enums.BoatStatusEnum;
|
||||||
@@ -176,6 +177,10 @@ public class RaceStatusCommand implements Command {
|
|||||||
//Record order in which boat finished leg.
|
//Record order in which boat finished leg.
|
||||||
visualiserRace.getLegCompletionOrder().get(boat.getCurrentLeg()).add(boat);
|
visualiserRace.getLegCompletionOrder().get(boat.getCurrentLeg()).add(boat);
|
||||||
|
|
||||||
|
//play sound
|
||||||
|
AudioClip sound = new AudioClip(getClass().getResource("/visualiser/sounds/buttonpress.mp3").toExternalForm());
|
||||||
|
sound.play();
|
||||||
|
|
||||||
//Update boat.
|
//Update boat.
|
||||||
boat.setCurrentLeg(leg);
|
boat.setCurrentLeg(leg);
|
||||||
boat.setTimeAtLastMark(visualiserRace.getRaceClock().getCurrentTime());
|
boat.setTimeAtLastMark(visualiserRace.getRaceClock().getCurrentTime());
|
||||||
|
|||||||
Reference in New Issue
Block a user