feat: di, db, and preliminary server-side gtfs parsing

This commit is contained in:
LavaDesu 2025-08-08 01:59:32 +10:00
parent ccc748dc1f
commit 6770c01613
Signed by: cilly
GPG key ID: 6500251E087653C9
22 changed files with 555 additions and 24 deletions

View file

@ -0,0 +1,12 @@
package moe.lava.banksia.model
import androidx.room.Entity
import androidx.room.PrimaryKey
@Entity
data class Route(
@PrimaryKey val id: String,
val type: RouteType,
val number: String?,
val name: String,
)

View file

@ -0,0 +1,23 @@
package moe.lava.banksia.model
import androidx.room.TypeConverter
enum class RouteType(val value: Int) {
MetroTrain(2),
MetroTram(3),
MetroBus(4),
RegionalTrain(1),
RegionalCoach(5),
RegionalBus(6),
SkyBus(11),
Interstate(10),
;
companion object {
@TypeConverter
fun from(value: Int) = RouteType.entries.first { it.value == value }
@TypeConverter
fun to(routeType: RouteType) = routeType.value
}
}

View file

@ -0,0 +1,16 @@
package moe.lava.banksia.model
import androidx.room.Entity
import androidx.room.PrimaryKey
import androidx.room.TypeConverters
import moe.lava.banksia.room.converter.ShapeConverter
import moe.lava.banksia.util.Point
typealias ShapePath = List<Point>
@Entity
@TypeConverters(ShapeConverter::class)
data class Shape(
@PrimaryKey val id: String,
val path: ShapePath,
)