diff --git a/src/itdelatrisu/opsu/GameData.java b/src/itdelatrisu/opsu/GameData.java index d0f95b69..a9473715 100644 --- a/src/itdelatrisu/opsu/GameData.java +++ b/src/itdelatrisu/opsu/GameData.java @@ -90,7 +90,7 @@ public class GameData { D (GameImage.RANKING_D, GameImage.RANKING_D_SMALL); /** GameImages associated with this grade (large and small sizes). */ - private GameImage large, small; + private final GameImage large, small; /** Large-size image scaled for use in song menu. */ private Image menuImage; @@ -202,14 +202,14 @@ public class GameData { */ private class HitErrorInfo { /** The correct hit time. */ - private int time; + private final int time; /** The coordinates of the hit. */ @SuppressWarnings("unused") - private int x, y; + private final int x, y; /** The difference between the correct and actual hit times. */ - private int timeDiff; + private final int timeDiff; /** * Constructor. @@ -235,32 +235,32 @@ public class GameData { /** Hit result helper class. */ private class HitObjectResult { /** Object start time. */ - public int time; + public final int time; /** Hit result. */ - public int result; + public final int result; /** Object coordinates. */ - public float x, y; + public final float x, y; /** Combo color. */ - public Color color; + public final Color color; /** The type of the hit object. */ - public HitObjectType hitResultType; + public final HitObjectType hitResultType; + + /** Slider curve. */ + public final Curve curve; + + /** Whether or not to expand when animating. */ + public final boolean expand; + + /** Whether or not to hide the hit result. */ + public final boolean hideResult; /** Alpha level (for fading out). */ public float alpha = 1f; - /** Slider curve. */ - public Curve curve; - - /** Whether or not to expand when animating. */ - public boolean expand; - - /** Whether or not to hide the hit result. */ - public boolean hideResult; - /** * Constructor. * @param time the result's starting track position diff --git a/src/itdelatrisu/opsu/GameImage.java b/src/itdelatrisu/opsu/GameImage.java index 112524f0..8d0dda19 100644 --- a/src/itdelatrisu/opsu/GameImage.java +++ b/src/itdelatrisu/opsu/GameImage.java @@ -359,22 +359,22 @@ public enum GameImage { IMG_JPG = 2; /** The file name. */ - private String filename; + private final String filename; /** The formatted file name string (for loading multiple images). */ private String filenameFormat; /** Image file type. */ - private byte type; + private final byte type; /** * Whether or not the image is skinnable by a beatmap. * These images are typically related to gameplay. */ - private boolean skinnable; + private final boolean skinnable; /** Whether or not to preload the image when the program starts. */ - private boolean preload; + private final boolean preload; /** The default image. */ private Image defaultImage; diff --git a/src/itdelatrisu/opsu/GameMod.java b/src/itdelatrisu/opsu/GameMod.java index cf28e809..4ef301ae 100644 --- a/src/itdelatrisu/opsu/GameMod.java +++ b/src/itdelatrisu/opsu/GameMod.java @@ -69,13 +69,13 @@ public enum GameMod { SPECIAL (2, "Special", Color.white); /** Drawing index. */ - private int index; + private final int index; /** Category name. */ - private String name; + private final String name; /** Text color. */ - private Color color; + private final Color color; /** The coordinates of the category. */ private float x, y; @@ -126,37 +126,37 @@ public enum GameMod { } /** The category for the mod. */ - private Category category; + private final Category category; /** The index in the category (for positioning). */ - private int categoryIndex; + private final int categoryIndex; /** The file name of the mod image. */ - private GameImage image; + private final GameImage image; /** The abbreviation for the mod. */ - private String abbrev; + private final String abbrev; /** * Bit value associated with the mod. * See the osu! API: https://github.com/peppy/osu-api/wiki#mods */ - private int bit; + private final int bit; /** The shortcut key associated with the mod. */ - private int key; + private final int key; /** The score multiplier. */ - private float multiplier; + private final float multiplier; /** Whether or not the mod is implemented. */ - private boolean implemented; + private final boolean implemented; /** The name of the mod. */ - private String name; + private final String name; /** The description of the mod. */ - private String description; + private final String description; /** Whether or not this mod is active. */ private boolean active = false; diff --git a/src/itdelatrisu/opsu/Options.java b/src/itdelatrisu/opsu/Options.java index c864ff97..9d824f26 100644 --- a/src/itdelatrisu/opsu/Options.java +++ b/src/itdelatrisu/opsu/Options.java @@ -459,13 +459,13 @@ public class Options { DISABLE_UPDATER ("Disable Automatic Updates", "DisableUpdater", "Disable automatic checking for updates upon starting opsu!.", false); /** Option name. */ - private String name; + private final String name; /** Option name, as displayed in the configuration file. */ - private String displayName; + private final String displayName; /** Option description. */ - private String description; + private final String description; /** The boolean value for the option (if applicable). */ protected boolean bool; @@ -487,7 +487,7 @@ public class Options { * @param displayName the option name, as displayed in the configuration file */ GameOption(String displayName) { - this.displayName = displayName; + this(null, displayName, null); } /** diff --git a/src/itdelatrisu/opsu/audio/HitSound.java b/src/itdelatrisu/opsu/audio/HitSound.java index 590f3ddb..6d0058dd 100644 --- a/src/itdelatrisu/opsu/audio/HitSound.java +++ b/src/itdelatrisu/opsu/audio/HitSound.java @@ -40,10 +40,10 @@ public enum HitSound implements SoundController.SoundComponent { // TAIKO ("taiko", 4); /** The sample set name. */ - private String name; + private final String name; /** The sample set index. */ - private int index; + private final int index; /** Total number of sample sets. */ public static final int SIZE = values().length; @@ -77,7 +77,7 @@ public enum HitSound implements SoundController.SoundComponent { private static SampleSet currentDefaultSampleSet = SampleSet.NORMAL; /** The file name. */ - private String filename; + private final String filename; /** The Clip associated with the hit sound. */ private HashMap clips; diff --git a/src/itdelatrisu/opsu/audio/MultiClip.java b/src/itdelatrisu/opsu/audio/MultiClip.java index 0d4da1c6..06e7ae22 100644 --- a/src/itdelatrisu/opsu/audio/MultiClip.java +++ b/src/itdelatrisu/opsu/audio/MultiClip.java @@ -49,7 +49,7 @@ public class MultiClip { private byte[] audioData; /** The name given to this clip. */ - private String name; + private final String name; /** * Constructor. diff --git a/src/itdelatrisu/opsu/audio/SoundEffect.java b/src/itdelatrisu/opsu/audio/SoundEffect.java index 03cabe3d..85aa64a9 100644 --- a/src/itdelatrisu/opsu/audio/SoundEffect.java +++ b/src/itdelatrisu/opsu/audio/SoundEffect.java @@ -42,7 +42,7 @@ public enum SoundEffect implements SoundController.SoundComponent { SPINNERSPIN ("spinnerspin"); /** The file name. */ - private String filename; + private final String filename; /** The Clip associated with the sound effect. */ private MultiClip clip; diff --git a/src/itdelatrisu/opsu/beatmap/BeatmapSortOrder.java b/src/itdelatrisu/opsu/beatmap/BeatmapSortOrder.java index a9c3c545..ad1d53c5 100644 --- a/src/itdelatrisu/opsu/beatmap/BeatmapSortOrder.java +++ b/src/itdelatrisu/opsu/beatmap/BeatmapSortOrder.java @@ -39,13 +39,13 @@ public enum BeatmapSortOrder { LENGTH (4, "Length", new LengthOrder()); /** The ID of the sort (used for tab positioning). */ - private int id; + private final int id; /** The name of the sort. */ - private String name; + private final String name; /** The comparator for the sort. */ - private Comparator comparator; + private final Comparator comparator; /** The tab associated with the sort (displayed in Song Menu screen). */ private MenuButton tab; diff --git a/src/itdelatrisu/opsu/downloads/Download.java b/src/itdelatrisu/opsu/downloads/Download.java index fddbd6a1..a3f62390 100644 --- a/src/itdelatrisu/opsu/downloads/Download.java +++ b/src/itdelatrisu/opsu/downloads/Download.java @@ -61,7 +61,7 @@ public class Download { ERROR ("Error"); /** The status name. */ - private String name; + private final String name; /** * Constructor. diff --git a/src/itdelatrisu/opsu/downloads/Updater.java b/src/itdelatrisu/opsu/downloads/Updater.java index 366fb623..8b7166e9 100644 --- a/src/itdelatrisu/opsu/downloads/Updater.java +++ b/src/itdelatrisu/opsu/downloads/Updater.java @@ -77,7 +77,7 @@ public class Updater { UPDATE_FINAL ("Update queued."); /** The status description. */ - private String description; + private final String description; /** * Constructor. diff --git a/src/itdelatrisu/opsu/replay/LifeFrame.java b/src/itdelatrisu/opsu/replay/LifeFrame.java index 045075f9..de7daea4 100644 --- a/src/itdelatrisu/opsu/replay/LifeFrame.java +++ b/src/itdelatrisu/opsu/replay/LifeFrame.java @@ -25,10 +25,10 @@ package itdelatrisu.opsu.replay; */ public class LifeFrame { /** Time. */ - private int time; + private final int time; /** Percentage. */ - private float percentage; + private final float percentage; /** * Constructor. diff --git a/src/itdelatrisu/opsu/replay/PlaybackSpeed.java b/src/itdelatrisu/opsu/replay/PlaybackSpeed.java index ec2fad6d..4b17adac 100644 --- a/src/itdelatrisu/opsu/replay/PlaybackSpeed.java +++ b/src/itdelatrisu/opsu/replay/PlaybackSpeed.java @@ -35,14 +35,14 @@ public enum PlaybackSpeed { HALF (GameImage.REPLAY_PLAYBACK_HALF, 0.5f); /** The button image. */ - private GameImage gameImage; + private final GameImage gameImage; + + /** The playback speed modifier. */ + private final float modifier; /** The button. */ private MenuButton button; - /** The playback speed modifier. */ - private float modifier; - /** Enum values. */ private static PlaybackSpeed[] values = PlaybackSpeed.values(); diff --git a/src/itdelatrisu/opsu/replay/ReplayFrame.java b/src/itdelatrisu/opsu/replay/ReplayFrame.java index 9f8e9f98..8f6e5095 100644 --- a/src/itdelatrisu/opsu/replay/ReplayFrame.java +++ b/src/itdelatrisu/opsu/replay/ReplayFrame.java @@ -38,13 +38,13 @@ public class ReplayFrame { private int timeDiff; /** Time, in milliseconds. */ - private int time; + private final int time; /** Cursor coordinates (in OsuPixels). */ - private float x, y; + private final float x, y; /** Keys pressed (bitmask). */ - private int keys; + private final int keys; /** * Returns the start frame. diff --git a/src/itdelatrisu/opsu/states/ButtonMenu.java b/src/itdelatrisu/opsu/states/ButtonMenu.java index 1892e0e7..1f21300e 100644 --- a/src/itdelatrisu/opsu/states/ButtonMenu.java +++ b/src/itdelatrisu/opsu/states/ButtonMenu.java @@ -256,7 +256,7 @@ public class ButtonMenu extends BasicGameState { }; /** The buttons in the state. */ - private Button[] buttons; + private final Button[] buttons; /** The associated MenuButton objects. */ private MenuButton[] menuButtons; @@ -548,10 +548,10 @@ public class ButtonMenu extends BasicGameState { }; /** The text to show on the button. */ - private String text; + private final String text; /** The button color. */ - private Color color; + private final Color color; /** * Constructor. @@ -594,7 +594,7 @@ public class ButtonMenu extends BasicGameState { private GameContainer container; private StateBasedGame game; private Input input; - private int state; + private final int state; public ButtonMenu(int state) { this.state = state; diff --git a/src/itdelatrisu/opsu/states/DownloadsMenu.java b/src/itdelatrisu/opsu/states/DownloadsMenu.java index 50f37fa9..219f61a3 100644 --- a/src/itdelatrisu/opsu/states/DownloadsMenu.java +++ b/src/itdelatrisu/opsu/states/DownloadsMenu.java @@ -162,10 +162,10 @@ public class DownloadsMenu extends BasicGameState { /** Search query helper class. */ private class SearchQuery implements Runnable { /** The search query. */ - private String query; + private final String query; /** The download server. */ - private DownloadServer server; + private final DownloadServer server; /** Whether the query was interrupted. */ private boolean interrupted = false; @@ -246,7 +246,7 @@ public class DownloadsMenu extends BasicGameState { private GameContainer container; private StateBasedGame game; private Input input; - private int state; + private final int state; public DownloadsMenu(int state) { this.state = state; diff --git a/src/itdelatrisu/opsu/states/Game.java b/src/itdelatrisu/opsu/states/Game.java index 823f359d..51c5780c 100644 --- a/src/itdelatrisu/opsu/states/Game.java +++ b/src/itdelatrisu/opsu/states/Game.java @@ -240,7 +240,7 @@ public class Game extends BasicGameState { private GameContainer container; private StateBasedGame game; private Input input; - private int state; + private final int state; public Game(int state) { this.state = state; diff --git a/src/itdelatrisu/opsu/states/GamePauseMenu.java b/src/itdelatrisu/opsu/states/GamePauseMenu.java index 7a01c492..84d61535 100644 --- a/src/itdelatrisu/opsu/states/GamePauseMenu.java +++ b/src/itdelatrisu/opsu/states/GamePauseMenu.java @@ -62,7 +62,7 @@ public class GamePauseMenu extends BasicGameState { private GameContainer container; private StateBasedGame game; private Input input; - private int state; + private final int state; private Game gameState; public GamePauseMenu(int state) { diff --git a/src/itdelatrisu/opsu/states/GameRanking.java b/src/itdelatrisu/opsu/states/GameRanking.java index 4fcc18ec..14afd314 100644 --- a/src/itdelatrisu/opsu/states/GameRanking.java +++ b/src/itdelatrisu/opsu/states/GameRanking.java @@ -68,7 +68,7 @@ public class GameRanking extends BasicGameState { // game-related variables private GameContainer container; private StateBasedGame game; - private int state; + private final int state; private Input input; public GameRanking(int state) { diff --git a/src/itdelatrisu/opsu/states/MainMenu.java b/src/itdelatrisu/opsu/states/MainMenu.java index 83d4951c..11f2a33a 100644 --- a/src/itdelatrisu/opsu/states/MainMenu.java +++ b/src/itdelatrisu/opsu/states/MainMenu.java @@ -122,7 +122,7 @@ public class MainMenu extends BasicGameState { private GameContainer container; private StateBasedGame game; private Input input; - private int state; + private final int state; public MainMenu(int state) { this.state = state; diff --git a/src/itdelatrisu/opsu/states/OptionsMenu.java b/src/itdelatrisu/opsu/states/OptionsMenu.java index 60a48ade..ea9bd251 100644 --- a/src/itdelatrisu/opsu/states/OptionsMenu.java +++ b/src/itdelatrisu/opsu/states/OptionsMenu.java @@ -114,10 +114,10 @@ public class OptionsMenu extends BasicGameState { private static OptionTab[] values = values(); /** Tab name. */ - private String name; + private final String name; /** Options array. */ - public GameOption[] options; + public final GameOption[] options; /** Associated tab button. */ public MenuButton button; @@ -167,7 +167,7 @@ public class OptionsMenu extends BasicGameState { private StateBasedGame game; private Input input; private Graphics g; - private int state; + private final int state; public OptionsMenu(int state) { this.state = state; diff --git a/src/itdelatrisu/opsu/states/SongMenu.java b/src/itdelatrisu/opsu/states/SongMenu.java index 44cd4834..01d1ad9e 100644 --- a/src/itdelatrisu/opsu/states/SongMenu.java +++ b/src/itdelatrisu/opsu/states/SongMenu.java @@ -209,7 +209,7 @@ public class SongMenu extends BasicGameState { private GameContainer container; private StateBasedGame game; private Input input; - private int state; + private final int state; public SongMenu(int state) { this.state = state; diff --git a/src/itdelatrisu/opsu/states/Splash.java b/src/itdelatrisu/opsu/states/Splash.java index d69b5b8a..c97ab6b3 100644 --- a/src/itdelatrisu/opsu/states/Splash.java +++ b/src/itdelatrisu/opsu/states/Splash.java @@ -67,7 +67,7 @@ public class Splash extends BasicGameState { private AnimatedValue logoAlpha; // game-related variables - private int state; + private final int state; private GameContainer container; private boolean init = false;