Open-source multiplayer game server compatible with the RuneScape client
https://www.openrs2.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
729 B
24 lines
729 B
package org.openrs2.game.cluster
|
|
|
|
import org.openrs2.cache.config.enum.EnumTypeList
|
|
import org.openrs2.conf.CountryCode
|
|
import org.openrs2.protocol.world.downstream.WorldListResponse
|
|
import javax.inject.Inject
|
|
import javax.inject.Singleton
|
|
|
|
@Singleton
|
|
public class CountryList @Inject constructor(
|
|
enums: EnumTypeList
|
|
) {
|
|
private val ids = enums[COUNTRY_IDS]!!
|
|
private val names = enums[COUNTRY_NAMES]!!
|
|
|
|
public operator fun get(code: CountryCode): WorldListResponse.Country {
|
|
return WorldListResponse.Country(ids.getInt(code.ordinal), names.getString(code.ordinal))
|
|
}
|
|
|
|
private companion object {
|
|
private const val COUNTRY_IDS = 1669
|
|
private const val COUNTRY_NAMES = 1626
|
|
}
|
|
}
|
|
|