import type { Airport } from "../../types/airport"; import { procedurallyGetIntegerBetween } from "../seed/procedurally-get-integer-between"; interface GetIndirectBundleCount { originAirport: Airport; destinationAirport: Airport; seed: number; } export const getIndirectBundleCount = ({ originAirport, destinationAirport, seed, }: GetIndirectBundleCount) => { const originAirportType = originAirport.type; const destinationAirportType = destinationAirport.type; const isLargeAirportFlight = originAirportType === "large_airport" && destinationAirportType === "large_airport"; const isMediumAirportFlight = originAirportType === "medium_airport" && destinationAirportType === "medium_airport"; if (isLargeAirportFlight) { return procedurallyGetIntegerBetween(seed, 60, 150); } if (isMediumAirportFlight) { return procedurallyGetIntegerBetween(seed, 20, 45); } return procedurallyGetIntegerBetween(seed, 40, 90); }; export const getMultipleConnectionBundleCount = ({ originAirport, destinationAirport, seed, }: GetIndirectBundleCount) => { const originAirportType = originAirport.type; const destinationAirportType = destinationAirport.type; const isLargeAirportFlight = originAirportType === "large_airport" && destinationAirportType === "large_airport"; const isMediumAirportFlight = originAirportType === "medium_airport" && destinationAirportType === "medium_airport"; if (isLargeAirportFlight) { return procedurallyGetIntegerBetween(seed, 160, 320); } if (isMediumAirportFlight) { return procedurallyGetIntegerBetween(seed, 60, 110); } return procedurallyGetIntegerBetween(seed, 90, 180); };