Bimba.git

ref: 67f5b3aad52d3fcabf3f0abe99afeaf8a2ed7203

app/src/main/java/xyz/apiote/bimba/czwek/api/structs/VehicleStatus.kt


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// SPDX-FileCopyrightText: Adam Evyčędo
//
// SPDX-License-Identifier: GPL-3.0-or-later

package xyz.apiote.bimba.czwek.api.structs

import xyz.apiote.bimba.czwek.api.UnknownResourceVersionException

enum class VehicleStatusV1 {
	IN_TRANSIT, INCOMING, AT_STOP, DEPARTED;

	companion object {
		fun of(type: UInt): VehicleStatusV1 {
			return when (type) {
				0u -> IN_TRANSIT
				1u -> INCOMING
				2u -> AT_STOP
				3u -> DEPARTED
				else -> throw UnknownResourceVersionException("VehicleStatus/$type", 1u)
			}
		}
	}
}