Skip to content

Commit

Permalink
✨ More time management when boarding a plane
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepyfran committed Oct 16, 2024
1 parent 3199543 commit d81915e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Duets.Entities/Types/Effect.Types.fs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module EffectTypes =
| ConcertSoundcheckPerformed
| Drank of item: Item * drink: DrinkableItem
| Exercised of Item
| FlightBoarded of Flight
| FlightBooked of Flight
| FlightUpdated of Flight
| FlightLanded of Flight
Expand Down
4 changes: 3 additions & 1 deletion src/Duets.Simulation/Flights/Airport.fs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ let boardPlane flight =

let situationEffect = Situations.onboardedInPlane flight

[ situationEffect; FlightUpdated { flight with AlreadyUsed = true } ],
[ situationEffect
FlightUpdated { flight with AlreadyUsed = true }
FlightBoarded flight ],
flightTimeInMinutes

/// Passes as many day moments needed for the flight to complete and leaves
Expand Down
1 change: 1 addition & 0 deletions src/Duets.Simulation/State/State.fs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ let applyEffect state effect =
| ConcertSoundcheckPerformed -> state
| Drank _ -> state
| Exercised _ -> state
| FlightBoarded _ -> state
| FlightBooked flight -> Flights.addBooking flight state
| FlightUpdated flight -> Flights.change flight state
| FlightLanded _ -> state
Expand Down
1 change: 1 addition & 0 deletions src/Duets.Simulation/Time/InteractionMinutes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ let effectMinutes =
| ConcertSoundcheckPerformed -> 45<minute>
| Drank _ -> 15<minute>
| Exercised _ -> 15<minute>
| FlightBoarded _ -> 25<minute>
| FlightLanded flight ->
Queries.Flights.flightTime flight |> Calendar.Seconds.toMinutes
| GamePlayed _ -> 30<minute>
Expand Down
2 changes: 1 addition & 1 deletion tests/Simulation.Tests/Airport/BoardPlane.Tests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let ``passSecurityCheck should drop all drinks from inventory`` () =

let effects = passSecurityCheck state

effects |> should haveLength 3
effects |> should haveLength 4

effects
|> List.filter (function
Expand Down

0 comments on commit d81915e

Please sign in to comment.