diff options
| author | anhgelus <anhgelus.morhtuuzh@proton.me> | 2024-08-23 13:44:29 +0000 |
|---|---|---|
| committer | anhgelus <anhgelus.morhtuuzh@proton.me> | 2024-08-23 13:44:29 +0000 |
| commit | 909f9ed08454a26e3c42d2cfcf9338cded41c8fb (patch) | |
| tree | 21bb3de048a2210d9c4dda8c78950f53ba970963 /src | |
| parent | 7fd5caf38a9b3ef71d94d9085ee92b47c3c449e3 (diff) | |
style(config): rename variables
SPACE_CASE used for non static var
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/java/world/anhgelus/molehunt/Game.java | 8 | ||||
| -rw-r--r-- | src/main/java/world/anhgelus/molehunt/config/Config.java | 12 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/world/anhgelus/molehunt/Game.java b/src/main/java/world/anhgelus/molehunt/Game.java index 54e5c3a..a50598e 100644 --- a/src/main/java/world/anhgelus/molehunt/Game.java +++ b/src/main/java/world/anhgelus/molehunt/Game.java @@ -18,7 +18,7 @@ import java.util.stream.Collectors; public class Game {
private Timer timer = new Timer();
- public final static int DEFAULT_TIME = Molehunt.CONFIG.GAME_DURATION;
+ public final static int DEFAULT_TIME = Molehunt.CONFIG.gameDuration;
private int remaining = DEFAULT_TIME;
private final MinecraftServer server;
@@ -35,10 +35,10 @@ public class Game { public void start() {
final int n;
- if (Molehunt.CONFIG.MOLE_COUNT < 0) {
- n = Math.floorDiv(server.getCurrentPlayerCount(), Math.floorDiv(100, (int) Molehunt.CONFIG.MOLE_PERCENTAGE));
+ if (Molehunt.CONFIG.moleCount < 0) {
+ n = Math.floorDiv(server.getCurrentPlayerCount(), Math.floorDiv(100, (int) Molehunt.CONFIG.molePercentage));
} else {
- n = Molehunt.CONFIG.MOLE_COUNT;
+ n = Molehunt.CONFIG.moleCount;
}
final var playerManager = server.getPlayerManager();
diff --git a/src/main/java/world/anhgelus/molehunt/config/Config.java b/src/main/java/world/anhgelus/molehunt/config/Config.java index 75301ad..a396a39 100644 --- a/src/main/java/world/anhgelus/molehunt/config/Config.java +++ b/src/main/java/world/anhgelus/molehunt/config/Config.java @@ -1,17 +1,17 @@ package world.anhgelus.molehunt.config; public class Config { - public final int GAME_DURATION; - public final double MOLE_PERCENTAGE; - public final int MOLE_COUNT; + public final int gameDuration; + public final double molePercentage; + public final int moleCount; public Config(String fileName) { final SimpleConfig CONFIG = SimpleConfig.of(fileName).provider(Config::defaultConfig).request(); // In seconds - GAME_DURATION = CONFIG.getOrDefault("game_duration", 90) * 60; - MOLE_PERCENTAGE = CONFIG.getOrDefault("mole_percentage", 25); - MOLE_COUNT = CONFIG.getOrDefault("mole_count", -1); + gameDuration = CONFIG.getOrDefault("game_duration", 90) * 60; + molePercentage = CONFIG.getOrDefault("mole_percentage", 25); + moleCount = CONFIG.getOrDefault("mole_count", -1); } private static String defaultConfig(String s) { |
