1+ package dev.slne.surf.surfapi.core.api.rarity
2+
3+ import dev.slne.surf.surfapi.core.api.messages.adventure.buildText
4+ import dev.slne.surf.surfapi.core.api.messages.builder.SurfComponentBuilder
5+ import net.kyori.adventure.text.ComponentLike
6+ import net.kyori.adventure.text.format.TextColor
7+
8+ /* *
9+ * Represents the rarity of an item or entity within the system.
10+ *
11+ * Each rarity level is associated with a display name and a color,
12+ * allowing visually distinct representations for different levels.
13+ *
14+ * @property displayName The visual display name of the rarity level.
15+ * @property color The textual color associated with the rarity level.
16+ */
17+ enum class Rarity (
18+ displayName : SurfComponentBuilder .() -> Unit ,
19+ val color : TextColor
20+ ) : ComponentLike {
21+ COMMON (
22+ displayName = { spacer(" Gewöhnlich" ) },
23+ color = TextColor .color(0xAAAAAA )
24+ ),
25+ UNCOMMON (
26+ displayName = { spacer(" Ungewöhnlich" ) },
27+ color = TextColor .color(0x55FF55 )
28+ ),
29+ RARE (
30+ displayName = { success(" Selten" ) },
31+ color = TextColor .color(0x55FFFF )
32+ ),
33+ EPIC (
34+ displayName = { info(" Episch" ) },
35+ color = TextColor .color(0xFF55FF )
36+ ),
37+ LEGENDARY (
38+ displayName = { warning(" Legendär" ) },
39+ color = TextColor .color(0xFFAA00 )
40+ ),
41+ MYTHIC (
42+ displayName = { error(" Mythisch" ) },
43+ color = TextColor .color(0xAA00AA )
44+ );
45+
46+ val displayName = buildText(displayName)
47+ override fun asComponent () = displayName
48+ }
0 commit comments