Skip to content

Commit d05f7db

Browse files
authored
Merge pull request #160 from TaskarCenterAtUW/feature-query-longform
Replace static filter with quest query from longform
2 parents 1368fd3 + 3a01567 commit d05f7db

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

GoInfoGame/GoInfoGame/quests/LongQuests/Classes/LongCrossingQuest.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,15 @@ class LongCrossingQuest: QuestBase, Quest {
3535
return _internalExpression
3636
}
3737
else {
38-
_internalExpression = try? filter.toElementFilterExpression()
38+
let crossingLongQuestQuery = QuestsRepository.shared.crossingsLongQuestModel?.questQuery
39+
var crossingFilter = ""
40+
41+
if let crossingLongQuestQuery = crossingLongQuestQuery {
42+
crossingFilter = crossingLongQuestQuery + " and !ext:gig_complete"
43+
} else {
44+
crossingFilter = "ways with (highway=footway and footway=crossing) and !ext:gig_complete"
45+
}
46+
_internalExpression = try? crossingFilter.toElementFilterExpression()
3947
return _internalExpression
4048
}
4149
}

GoInfoGame/GoInfoGame/quests/LongQuests/Classes/LongKerbQuest.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,15 @@ class LongKerbQuest: QuestBase, Quest {
3737
return _internalExpression
3838
}
3939
else {
40-
_internalExpression = try? filter.toElementFilterExpression()
40+
let kerbLongQuestQuery = QuestsRepository.shared.kerbLongQuestModel?.questQuery
41+
var kerbFilter = ""
42+
43+
if let kerbLongQuestQuery = kerbLongQuestQuery {
44+
kerbFilter = kerbLongQuestQuery + " and !ext:gig_complete"
45+
} else {
46+
kerbFilter = "nodes with barrier=kerb and !ext:gig_complete"
47+
}
48+
_internalExpression = try? kerbFilter.toElementFilterExpression()
4149
return _internalExpression
4250
}
4351
}

GoInfoGame/GoInfoGame/quests/LongQuests/Classes/LongSidewalkQuest.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,15 @@ class LongSidewalkQuest: QuestBase, Quest {
4141
return _internalExpression
4242
}
4343
else {
44-
_internalExpression = try? filter.toElementFilterExpression()
44+
let sideWalkLongQuestQuery = QuestsRepository.shared.sideWalkLongQuestModel?.questQuery
45+
var sideWalkFilter = ""
46+
47+
if let sideWalkLongQuestQuery = sideWalkLongQuestQuery {
48+
sideWalkFilter = sideWalkLongQuestQuery + " and !ext:gig_complete"
49+
} else {
50+
sideWalkFilter = "ways with (highway=footway and footway=sidewalk) and !ext:gig_complete"
51+
}
52+
_internalExpression = try? sideWalkFilter.toElementFilterExpression()
4553
return _internalExpression
4654
}
4755
}

0 commit comments

Comments
 (0)