@@ -14,12 +14,6 @@ sealed class ItineraryItem {
14
14
abstract val costs: List <Money >
15
15
}
16
16
17
- val ItineraryItem .mapOverlay: MapOverlay get() = when (this ) {
18
- is Accommodation -> mapOverlay
19
- is Attraction -> mapOverlay
20
- is Journey -> mapOverlay
21
- is RestaurantBooking -> mapOverlay
22
- }
23
17
24
18
data class Accommodation (
25
19
override val id : Id <Accommodation >,
@@ -28,25 +22,15 @@ data class Accommodation(
28
22
val checkOutBefore : ZonedDateTime ,
29
23
val pricePerNight : Money
30
24
) : ItineraryItem() {
31
- val nights = Period .between(
32
- checkInFrom.toLocalDate(),
33
- checkOutBefore.toLocalDate()
34
- ).days
25
+ val nights = Period .between(checkInFrom.toLocalDate(), checkOutBefore.toLocalDate()).days
35
26
val totalPrice: Money = pricePerNight * nights
36
27
37
28
override val description
38
29
get() = " $nights nights at ${location.userReadableName} "
39
30
override val costs
40
31
get() = listOf (totalPrice)
41
- }
42
32
43
- val Accommodation .mapOverlay
44
- get() = PointOverlay (
45
- id = id,
46
- position = location.position,
47
- text = location.userReadableName,
48
- icon = StandardIcons .HOTEL
49
- )
33
+ }
50
34
51
35
data class Attraction (
52
36
override val id : Id <Attraction >,
@@ -61,14 +45,6 @@ data class Attraction(
61
45
62
46
}
63
47
64
- val Attraction .mapOverlay get() =
65
- PointOverlay (
66
- position = location.position,
67
- text = description,
68
- icon = StandardIcons .ATTRACTION ,
69
- id = id
70
- )
71
-
72
48
data class Journey (
73
49
override val id : Id <Journey >,
74
50
val travelMethod : TravelMethod ,
@@ -89,16 +65,6 @@ data class Journey(
89
65
90
66
}
91
67
92
- val Journey .mapOverlay
93
- get() = OverlayGroup (
94
- id = id,
95
- elements = listOf (
96
- PathOverlay (path, travelMethod.userReadableName),
97
- PointOverlay (departsFrom.position, departsFrom.userReadableName, StandardIcons .START ),
98
- PointOverlay (arrivesAt.position, arrivesAt.userReadableName, StandardIcons .END )
99
- )
100
- )
101
-
102
68
data class RestaurantBooking (
103
69
override val id : Id <RestaurantBooking >,
104
70
val location : Location ,
@@ -107,12 +73,4 @@ data class RestaurantBooking(
107
73
override val description get() = location.userReadableName
108
74
109
75
override val costs get() = emptyList<Money >()
110
- }
111
-
112
- val RestaurantBooking .mapOverlay get() =
113
- PointOverlay (
114
- id = id,
115
- position = location.position,
116
- text = location.userReadableName,
117
- icon = StandardIcons .RESTAURANT
118
- )
76
+ }
0 commit comments