Type enum
Пакет: com.hypixel.hytale.server.worldgen.loader.context
Файл: com/hypixel/hytale/server/worldgen/loader/context/BiomeFileContext.java
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
|
private final String |
displayName |
|
private final String |
prefix |
|
private final String |
suffix |
Методы (5)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
|
Custom Custom("Custom.", "Custom Biome") |
|
public String |
getDisplayNamepublic String getDisplayName() |
|
public String |
getPrefixpublic String getPrefix() |
|
public String |
getSuffixpublic String getSuffix() |
abstract |
|
this this(nullxx, ".json", nullxxx) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.worldgen.loader.context;
class="kw">import com.hypixel.hytale.procedurallib.file.AssetPath;
class="kw">import java.nio.file.Path;
class="kw">import javax.annotation.Nonnull;
class="kw">public class BiomeFileContext class="kw">extends FileContext<ZoneFileContext> {
class="kw">private class="kw">final BiomeFileContext.Type type;
class="kw">public BiomeFileContext(int var1, @Nonnull String var2, @Nonnull Path var3, @Nonnull BiomeFileContext.Type var4, @Nonnull ZoneFileContext var5) {
super(var1, var2, var3, var5);
this.type = var4;
}
class="kw">public BiomeFileContext.Type getType() {
class="kw">return this.type;
}
@Nonnull
class="kw">public class="kw">static BiomeFileContext.Type getBiomeType(@Nonnull AssetPath var0) {
String var1 = var0.getFileName();
for (BiomeFileContext.Type var5 : BiomeFileContext.Type.values()) {
if (var1.startsWith(var5.prefix) && var1.endsWith(var5.suffix)) {
class="kw">return var5;
}
}
throw new Error("Unable to determine biome Type from file: " + var0);
}
class="kw">public enum Type {
Tile("Tile.", "Tile Biome"),
Custom("Custom.", "Custom Biome");
class="kw">private class="kw">final String prefix;
class="kw">private class="kw">final String suffix;
class="kw">private class="kw">final String displayName;
Type(String nullxx, String nullxxx) {
this(nullxx, ".json", nullxxx);
}
Type(String nullxx, String nullxxx, String nullxxxx) {
this.prefix = nullxx;
this.suffix = nullxxx;
this.displayName = nullxxxx;
}
class="kw">public String getPrefix() {
class="kw">return this.prefix;
}
class="kw">public String getSuffix() {
class="kw">return this.suffix;
}
class="kw">public String getDisplayName() {
class="kw">return this.displayName;
}
}
}