From 909f9ed08454a26e3c42d2cfcf9338cded41c8fb Mon Sep 17 00:00:00 2001 From: anhgelus Date: Fri, 23 Aug 2024 13:44:29 +0000 Subject: style(config): rename variables SPACE_CASE used for non static var --- src/main/java/world/anhgelus/molehunt/Game.java | 8 ++++---- src/main/java/world/anhgelus/molehunt/config/Config.java | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/main/java') 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) { -- cgit v1.2.3