fix: Model cleanup
This commit is contained in:
parent
f600303b5f
commit
85e4fdb858
2 changed files with 0 additions and 41 deletions
|
@ -9,7 +9,6 @@ import com.mapbox.navigation.tripdata.maneuver.model.StepDistance
|
||||||
|
|
||||||
class DataCache {
|
class DataCache {
|
||||||
|
|
||||||
private val garminManeuver: GarminManeuver = GarminManeuver.empty()
|
|
||||||
private var maneuverCache: Maneuver? = null
|
private var maneuverCache: Maneuver? = null
|
||||||
private var locationCache: LocationMatcherResult? = null
|
private var locationCache: LocationMatcherResult? = null
|
||||||
private var session: NavigationSessionState? = null
|
private var session: NavigationSessionState? = null
|
||||||
|
|
|
@ -130,43 +130,3 @@ class Direction(
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface GarminModelItem {
|
|
||||||
|
|
||||||
fun merge(item: GarminModelItem)
|
|
||||||
}
|
|
||||||
|
|
||||||
class GarminManeuver : GarminModelItem {
|
|
||||||
|
|
||||||
lateinit var lanes: Lanes
|
|
||||||
lateinit var direction: Direction
|
|
||||||
lateinit var distance: Distance
|
|
||||||
var flag: Boolean = false // WTF?
|
|
||||||
|
|
||||||
override fun merge(item: GarminModelItem) {
|
|
||||||
val maneuver = item as GarminManeuver
|
|
||||||
this.lanes = maneuver.lanes
|
|
||||||
this.direction = maneuver.direction
|
|
||||||
this.distance = maneuver.distance
|
|
||||||
this.flag = maneuver.flag
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
|
|
||||||
val empty: () -> GarminManeuver = {
|
|
||||||
val manouver = GarminManeuver()
|
|
||||||
manouver.lanes = Lanes(Arrows(setOf()), Arrows(setOf()))
|
|
||||||
manouver.direction = Direction(out = OutType.Off)
|
|
||||||
manouver.distance = Distance(0.0, Unit.Any)
|
|
||||||
manouver
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class GarminLocation : GarminModelItem {
|
|
||||||
|
|
||||||
override fun merge(item: GarminModelItem) {
|
|
||||||
TODO("Not yet implemented")
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue