mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-15 18:34:56 -04:00
network: TeamsS2CP: fix invalid enum value error
This commit is contained in:
parent
5be0c5bcfe
commit
0a69eca1cc
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Minosoft
|
||||
* Copyright (C) 2021 Moritz Zwerger
|
||||
* Copyright (C) 2020-2023 Moritz Zwerger
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
*
|
||||
@ -13,22 +13,27 @@
|
||||
|
||||
package de.bixilon.minosoft.data.scoreboard
|
||||
|
||||
import de.bixilon.kutil.enums.AliasableEnum
|
||||
import de.bixilon.kutil.enums.EnumUtil
|
||||
import de.bixilon.kutil.enums.ValuesEnum
|
||||
|
||||
enum class NameTagVisibilities(vararg names: String) : AliasableEnum {
|
||||
enum class NameTagVisibilities {
|
||||
ALWAYS,
|
||||
HIDE_FOR_ENEMIES("hideForOtherTeams"),
|
||||
HIDE_FOR_MATES("hideForOwnTeam"),
|
||||
HIDE_FOR_ENEMIES,
|
||||
HIDE_FOR_MATES,
|
||||
NEVER,
|
||||
;
|
||||
|
||||
override val names: Array<String> = names.toList().toTypedArray()
|
||||
|
||||
companion object : ValuesEnum<NameTagVisibilities> {
|
||||
override val VALUES: Array<NameTagVisibilities> = values()
|
||||
override val NAME_MAP: Map<String, NameTagVisibilities> = EnumUtil.getEnumValues(VALUES)
|
||||
|
||||
|
||||
override fun get(name: String): NameTagVisibilities {
|
||||
return when (name) {
|
||||
"hideForOwnTeam" -> HIDE_FOR_MATES
|
||||
"hideForOtherTeams" -> HIDE_FOR_ENEMIES
|
||||
else -> super.get(name)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user