Skip to content

Commit f82009c

Browse files
committed
Update announcements.ts
1 parent 85f7073 commit f82009c

File tree

1 file changed

+28
-18
lines changed

1 file changed

+28
-18
lines changed

src/scripts/announcements.ts

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,34 @@ export default class Annoucements implements CallbackHook {
4040
newPhase: PirepState,
4141
oldPhase: PirepState,
4242
) {
43-
if (newPhase == PirepState.Pushback) {
44-
Acars.PlayAudio('pushback.mp3')
45-
} else if (newPhase == PirepState.TaxiIn) {
46-
Acars.PlayAudio('taxi_in.mp3')
47-
} else if (newPhase == PirepState.TaxiOut) {
48-
Acars.PlayAudio('taxi_out.mp3')
49-
} else if (newPhase == PirepState.Takeoff) {
50-
Acars.PlayAudio('takeoff.mp3')
51-
} else if (newPhase == PirepState.Enroute) {
52-
Acars.PlayAudio('enroute.mp3')
53-
} else if (newPhase == PirepState.Approach) {
54-
Acars.PlayAudio('approach.mp3')
55-
} else if (newPhase == PirepState.Final) {
56-
Acars.PlayAudio('landing.mp3')
57-
} else if (newPhase == PirepState.Landed) {
58-
Acars.PlayAudio('landing.mp3')
59-
} else if (newPhase == PirepState.Arrived) {
60-
Acars.PlayAudio('arrived.mp3')
43+
switch (newPhase) {
44+
case PirepState.Pushback:
45+
Acars.PlayAudio('pushback.mp3')
46+
break
47+
case PirepState.TaxiOut:
48+
Acars.PlayAudio('taxi_out.mp3')
49+
break
50+
case PirepState.Takeoff:
51+
Acars.PlayAudio('takeoff.mp3')
52+
break
53+
case PirepState.Enroute:
54+
Acars.PlayAudio('enroute.mp3')
55+
break
56+
case PirepState.Approach:
57+
Acars.PlayAudio('approach.mp3')
58+
break
59+
case PirepState.Final:
60+
Acars.PlayAudio('landing.mp3')
61+
break
62+
case PirepState.Landed:
63+
Acars.PlayAudio('landing.mp3')
64+
break
65+
case PirepState.TaxiIn:
66+
Acars.PlayAudio('taxi_in.mp3')
67+
break
68+
case PirepState.Arrived:
69+
Acars.PlayAudio('arrived.mp3')
70+
break
6171
}
6272
}
6373
}

0 commit comments

Comments
 (0)