-
-
Notifications
You must be signed in to change notification settings - Fork 340
/
AddParkingFee.kt
30 lines (24 loc) · 1.17 KB
/
AddParkingFee.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package de.westnordost.streetcomplete.quests.parking_fee
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.geometry.ElementGeometry
import de.westnordost.streetcomplete.data.osm.osmquests.OsmFilterQuestType
import de.westnordost.streetcomplete.data.user.achievements.EditTypeAchievement.CAR
import de.westnordost.streetcomplete.osm.Tags
class AddParkingFee : OsmFilterQuestType<FeeAndMaxStay>() {
override val elementFilter = """
nodes, ways, relations with amenity = parking
and access ~ yes|customers|public
and (
!fee and !fee:conditional
or fee older today -8 years
)
"""
override val changesetComment = "Specify whether parking requires a fee"
override val wikiLink = "Tag:amenity=parking"
override val icon = R.drawable.ic_quest_parking_fee
override val achievements = listOf(CAR)
override fun getTitle(tags: Map<String, String>) = R.string.quest_parking_fee_title
override fun createForm() = AddParkingFeeForm()
override fun applyAnswerTo(answer: FeeAndMaxStay, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) =
answer.applyTo(tags)
}