Skip to content

Commit

Permalink
creating helper for isShared
Browse files Browse the repository at this point in the history
  • Loading branch information
Xuan-1998 committed Aug 24, 2022
1 parent 87ac571 commit 895a822
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,9 @@ trait ChoosesMode {
}
var availableVehicles = newlyAvailableBeamVehicles.map(_.streetVehicle) :+ bodyStreetVehicle
personData.currentTourMode match {
case Some(WALK_BASED) => availableVehicles = availableVehicles,
case Some(WALK_BASED) => availableVehicles = availableVehicles,

case Some(BIKE_BASED) => availableVehicles = newlyAvailableBeamVehicles.filterNot(v => BeamVehicle.isSharedTeleportationVehicle(v.id)).map(_.streetVehicle)
case Some(WALK_BASED) => availableVehicles = availableVehicles
case Some(CAR_BASED) => availableVehicles = availableVehicles
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ object BeamVehicle {

val idPrefixSharedTeleportationVehicle = "teleportationSharedVehicle"
val idPrefixRideHail = "rideHailVehicle"
val idPrefixSharedVehicle = "sharedVehicle"

def isRidehailVehicle(vehicleId: Id[BeamVehicle]): Boolean = {
vehicleId.toString.startsWith(idPrefixRideHail)
Expand All @@ -554,6 +555,9 @@ object BeamVehicle {
def isSharedTeleportationVehicle(vehicleId: Id[BeamVehicle]): Boolean = {
vehicleId.toString.startsWith(idPrefixSharedTeleportationVehicle)
}
def isSharedVehicle(vehicleId: Id[BeamVehicle]): Boolean = {
vehicleId.toString.startsWith(idPrefixSharedVehicle)
}

def noSpecialChars(theString: String): String =
theString
Expand Down

0 comments on commit 895a822

Please sign in to comment.