feat: Lane assist

This commit is contained in:
Piotr Dec 2024-08-01 23:28:49 +02:00
parent f5ec500343
commit 386bb50621
Signed by: stawros
GPG key ID: F89F27AD8F881A91
3 changed files with 33 additions and 12 deletions

View file

@ -47,11 +47,15 @@ enum class Lane(val value: Int) {
InnerLeft(0x10),
MiddleLeft(0x20),
OuterLeft(0x40),
DotsLeft(0x80)
DotsLeft(0x80);
companion object {
val iterator = {sortedSetOf(OuterRight, MiddleRight, InnerRight, InnerLeft, MiddleLeft, OuterLeft).iterator()}
}
}
class Arrows(val lanes: List<Lane>) {
class Arrows(val lanes: Set<Lane>) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
@ -151,7 +155,7 @@ class GarminManeuver : GarminModelItem {
val empty: () -> GarminManeuver = {
val manouver = GarminManeuver()
manouver.lanes = Lanes(Arrows(listOf()), Arrows(listOf()))
manouver.lanes = Lanes(Arrows(setOf()), Arrows(setOf()))
manouver.direction = Direction(out = OutType.Off)
manouver.distance = Distance(0.0, Unit.Any)
manouver