@@ -142,14 +142,18 @@ public class TripOptions: NSObject, NSSecureCoding {
142
142
public var options : [ Option ] ?
143
143
public var maxChanges : Int ?
144
144
public var minChangeTime : Int ? // in minutes
145
+ public var maxFootpathTime : Int ? // in minutes
146
+ public var maxFootpathDist : Int ? // in meters
145
147
146
- public init ( products: [ Product ] ? = nil , optimize: Optimize ? = nil , walkSpeed: WalkSpeed ? = nil , accessibility: Accessibility ? = nil , options: [ Option ] ? = nil , maxChanges: Int ? = nil , minChangeTime: Int ? = nil ) {
148
+ public init ( products: [ Product ] ? = nil , optimize: Optimize ? = nil , walkSpeed: WalkSpeed ? = nil , accessibility: Accessibility ? = nil , options: [ Option ] ? = nil , maxChanges: Int ? = nil , minChangeTime: Int ? = nil , maxFootpathTime : Int ? = nil , maxFootpathDist : Int ? = nil ) {
147
149
self . products = products
148
150
self . optimize = optimize
149
151
self . accessibility = accessibility
150
152
self . options = options
151
153
self . maxChanges = maxChanges
152
154
self . minChangeTime = minChangeTime
155
+ self . maxFootpathTime = maxFootpathTime
156
+ self . maxFootpathDist = maxFootpathDist
153
157
}
154
158
155
159
public required convenience init ? ( coder aDecoder: NSCoder ) {
@@ -162,7 +166,9 @@ public class TripOptions: NSObject, NSSecureCoding {
162
166
let options = optionsInt? . compactMap { Option ( rawValue: $0) }
163
167
let maxChanges = aDecoder. decodeObject ( of: NSNumber . self, forKey: PropertyKey . maxChanges) as? Int
164
168
let minChangeTime = aDecoder. decodeObject ( of: NSNumber . self, forKey: PropertyKey . minChangeTime) as? Int
165
- self . init ( products: products, optimize: optimize, walkSpeed: walkSpeed, accessibility: accessibility, options: options, maxChanges: maxChanges, minChangeTime: minChangeTime)
169
+ let maxFootpathTime = aDecoder. decodeObject ( of: NSNumber . self, forKey: PropertyKey . maxFootpathTime) as? Int
170
+ let maxFootpathDist = aDecoder. decodeObject ( of: NSNumber . self, forKey: PropertyKey . maxFootpathDist) as? Int
171
+ self . init ( products: products, optimize: optimize, walkSpeed: walkSpeed, accessibility: accessibility, options: options, maxChanges: maxChanges, minChangeTime: minChangeTime, maxFootpathTime: maxFootpathTime, maxFootpathDist: maxFootpathDist)
166
172
}
167
173
168
174
public func encode( with aCoder: NSCoder ) {
@@ -175,6 +181,8 @@ public class TripOptions: NSObject, NSSecureCoding {
175
181
aCoder. encode ( options? . map { $0. rawValue } , forKey: PropertyKey . options)
176
182
aCoder. encode ( maxChanges, forKey: PropertyKey . maxChanges)
177
183
aCoder. encode ( minChangeTime, forKey: PropertyKey . minChangeTime)
184
+ aCoder. encode ( maxFootpathTime, forKey: PropertyKey . maxFootpathTime)
185
+ aCoder. encode ( maxFootpathDist, forKey: PropertyKey . maxFootpathDist)
178
186
}
179
187
180
188
struct PropertyKey {
@@ -185,9 +193,11 @@ public class TripOptions: NSObject, NSSecureCoding {
185
193
static let options = " options "
186
194
static let maxChanges = " maxChanges "
187
195
static let minChangeTime = " minChangeTime "
196
+ static let maxFootpathTime = " maxFootpathTime "
197
+ static let maxFootpathDist = " maxFootpathDist "
188
198
}
189
199
}
190
200
191
201
public enum QueryTrait : Int {
192
- case maxChanges, minChangeTime
202
+ case maxChanges, minChangeTime, maxFootpathTime , maxFootpathDist
193
203
}
0 commit comments