forked from streetcomplete/StreetComplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
AddBridgeStructure.kt
30 lines (24 loc) · 1.16 KB
/
AddBridgeStructure.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.bridge_structure
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.BUILDING
import de.westnordost.streetcomplete.osm.Tags
class AddBridgeStructure : OsmFilterQuestType<BridgeStructure>() {
override val elementFilter = """
ways with
man_made = bridge
and !bridge:structure
and !bridge:movable
and (!indoor or indoor = no)
"""
override val changesetComment = "Specify bridge structures"
override val wikiLink = "Key:bridge:structure"
override val icon = R.drawable.ic_quest_bridge
override val achievements = listOf(BUILDING)
override fun getTitle(tags: Map<String, String>) = R.string.quest_bridge_structure_title
override fun createForm() = AddBridgeStructureForm()
override fun applyAnswerTo(answer: BridgeStructure, tags: Tags, geometry: ElementGeometry, timestampEdited: Long) {
tags["bridge:structure"] = answer.osmValue
}
}