refactor(player): encapsulate game state behind PlayerSettings, clear VisibilityModifier and HiddenField
- ParkourUser/ParkourPlayer/GeneratorState public mutable fields -> private + short accessors - per-player settings extracted to player/data/PlayerSettings (ParkourPlayer 188 -> 96 lines, PMD-counted methods 20 -> 9); this is what fixed the TooManyMethods violation that the encapsulation itself introduced — by decomposition, not by lowering the threshold - disk storage reads and writes the same canonical 12-key map as the SQL JSON column; legacy key names normalized on read, @Expose dropped from domain classes - 39 settings call sites rewritten across 7 files - HiddenField backlog cleared (Config, ObstacleGenerator, GhostService, Leaderboard, PagedMenu, Reward, ParticleData, World) - checkstyle ratchet: VisibilityModifier, HiddenField, EmptyLineSeparator and MissingDeprecated flipped to error once their counters hit zero; suppressions.xml empty - javac -Xmaxwarns raised so NullAway/Error Prone counts are honest (baseline 165/289, now 164/265) checkstyle 0 errors / 135 warnings, PMD 0 violations, tests 94/0 fail, ./gradlew check green. TODO.md: items 30 and 107 updated, new items 167-170, ПРОГРЕСС-6/7 recorded.
This commit is contained in:
parent
c120309663
commit
02e2947f47
90 changed files with 1103 additions and 660 deletions
|
|
@ -21,35 +21,91 @@ public final class Modes {
|
|||
private Modes() {
|
||||
}
|
||||
|
||||
public static DefaultMode DEFAULT;
|
||||
public static SpectatorMode SPECTATOR;
|
||||
public static SpeedrunMode SPEEDRUN;
|
||||
public static InvisibleBarrierMode INVISIBLE_BARRIER;
|
||||
public static RaceMode RACE;
|
||||
public static CoopMode COOP;
|
||||
public static GravityShiftMode GRAVITY_SHIFT;
|
||||
public static ElytraMode ELYTRA;
|
||||
public static SpeedDemonMode SPEED_DEMON;
|
||||
public static MinSpeedMode MIN_SPEED;
|
||||
public static TimeTrialMode TIME_TRIAL;
|
||||
public static CloseMode CLOSE;
|
||||
public static ObstacleMode OBSTACLE;
|
||||
public static DuelsMode DUELS;
|
||||
private static DefaultMode defaultMode;
|
||||
private static SpectatorMode spectator;
|
||||
private static SpeedrunMode speedrun;
|
||||
private static InvisibleBarrierMode invisibleBarrier;
|
||||
private static RaceMode race;
|
||||
private static CoopMode coop;
|
||||
private static GravityShiftMode gravityShift;
|
||||
private static ElytraMode elytra;
|
||||
private static SpeedDemonMode speedDemon;
|
||||
private static MinSpeedMode minSpeed;
|
||||
private static TimeTrialMode timeTrial;
|
||||
private static CloseMode close;
|
||||
private static ObstacleMode obstacle;
|
||||
private static DuelsMode duels;
|
||||
|
||||
public static void init() {
|
||||
DEFAULT = (DefaultMode) Registry.getMode("default");
|
||||
SPECTATOR = (SpectatorMode) Registry.getMode("spectator");
|
||||
SPEEDRUN = (SpeedrunMode) Registry.getMode("speedrun");
|
||||
INVISIBLE_BARRIER = (InvisibleBarrierMode) Registry.getMode("invisible-barrier");
|
||||
RACE = (RaceMode) Registry.getMode("race");
|
||||
COOP = (CoopMode) Registry.getMode("coop");
|
||||
GRAVITY_SHIFT = (GravityShiftMode) Registry.getMode("gravity-shift");
|
||||
ELYTRA = (ElytraMode) Registry.getMode("elytra");
|
||||
SPEED_DEMON = (SpeedDemonMode) Registry.getMode("speeddemon");
|
||||
MIN_SPEED = (MinSpeedMode) Registry.getMode("minspeed");
|
||||
TIME_TRIAL = (TimeTrialMode) Registry.getMode("timetrial");
|
||||
CLOSE = (CloseMode) Registry.getMode("close");
|
||||
OBSTACLE = (ObstacleMode) Registry.getMode("obstacle");
|
||||
DUELS = (DuelsMode) Registry.getMode("duels");
|
||||
defaultMode = (DefaultMode) Registry.getMode("default");
|
||||
spectator = (SpectatorMode) Registry.getMode("spectator");
|
||||
speedrun = (SpeedrunMode) Registry.getMode("speedrun");
|
||||
invisibleBarrier = (InvisibleBarrierMode) Registry.getMode("invisible-barrier");
|
||||
race = (RaceMode) Registry.getMode("race");
|
||||
coop = (CoopMode) Registry.getMode("coop");
|
||||
gravityShift = (GravityShiftMode) Registry.getMode("gravity-shift");
|
||||
elytra = (ElytraMode) Registry.getMode("elytra");
|
||||
speedDemon = (SpeedDemonMode) Registry.getMode("speeddemon");
|
||||
minSpeed = (MinSpeedMode) Registry.getMode("minspeed");
|
||||
timeTrial = (TimeTrialMode) Registry.getMode("timetrial");
|
||||
close = (CloseMode) Registry.getMode("close");
|
||||
obstacle = (ObstacleMode) Registry.getMode("obstacle");
|
||||
duels = (DuelsMode) Registry.getMode("duels");
|
||||
}
|
||||
|
||||
public static DefaultMode defaultMode() {
|
||||
return defaultMode;
|
||||
}
|
||||
|
||||
public static SpectatorMode spectator() {
|
||||
return spectator;
|
||||
}
|
||||
|
||||
public static SpeedrunMode speedrun() {
|
||||
return speedrun;
|
||||
}
|
||||
|
||||
public static InvisibleBarrierMode invisibleBarrier() {
|
||||
return invisibleBarrier;
|
||||
}
|
||||
|
||||
public static RaceMode race() {
|
||||
return race;
|
||||
}
|
||||
|
||||
public static CoopMode coop() {
|
||||
return coop;
|
||||
}
|
||||
|
||||
public static GravityShiftMode gravityShift() {
|
||||
return gravityShift;
|
||||
}
|
||||
|
||||
public static ElytraMode elytra() {
|
||||
return elytra;
|
||||
}
|
||||
|
||||
public static SpeedDemonMode speedDemon() {
|
||||
return speedDemon;
|
||||
}
|
||||
|
||||
public static MinSpeedMode minSpeed() {
|
||||
return minSpeed;
|
||||
}
|
||||
|
||||
public static TimeTrialMode timeTrial() {
|
||||
return timeTrial;
|
||||
}
|
||||
|
||||
public static CloseMode close() {
|
||||
return close;
|
||||
}
|
||||
|
||||
public static ObstacleMode obstacle() {
|
||||
return obstacle;
|
||||
}
|
||||
|
||||
public static DuelsMode duels() {
|
||||
return duels;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue