Skip to content

Commit

Permalink
Make fields final if possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
tsaglam committed Feb 4, 2024
1 parent 04ece25 commit f2ef751
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
public abstract class AbstractGameState { // TODO (HIGH) [AI] separate human move states from AI moves?

private StateMachine stateMachine;
private final StateMachine stateMachine;
protected GameSettings settings;
protected ViewFacade views;
protected Round round;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/carcassonne/control/state/StateManning.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @author Timur Saglam
*/
public class StateManning extends AbstractGameState {
private boolean[] noMeeplesNotification;
private final boolean[] noMeeplesNotification;

/**
* Constructor of the state.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/carcassonne/model/grid/GridPattern.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public class GridPattern {

private boolean disbursed;
protected boolean complete;
private Map<Player, Integer> involvedPlayers;
private List<Meeple> meepleList;
private final Map<Player, Integer> involvedPlayers;
private final List<Meeple> meepleList;
protected final TerrainType patternType;
protected int scoreMultiplier;
protected List<GridSpot> containedSpots;
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/carcassonne/view/main/MeepleLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
*/
public class MeepleLayer extends JPanel {
private static final long serialVersionUID = -843137441362337953L;
private List<MeepleDepictionPanel> meeplePanels;
private MeepleDepictionPanel[][] meeplePanelGrid;
private JComponent[][] placeholderGrid;
private final List<MeepleDepictionPanel> meeplePanels;
private final MeepleDepictionPanel[][] meeplePanelGrid;
private final JComponent[][] placeholderGrid;
private final List<RigidRectangle> placeholders;
private int zoomLevel;
private ControllerFacade controller;
private final ControllerFacade controller;

/**
* Creates the meeple layer.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/carcassonne/view/main/TileLayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
public class TileLayer extends JPanel {
private static final long serialVersionUID = 1503933201337556131L;
private final List<TileDepiction> placementHighlights;
private List<TileDepiction> tileLabels;
private TileDepiction[][] tileDepictionGrid;
private final List<TileDepiction> tileLabels;
private final TileDepiction[][] tileDepictionGrid;

/**
* Creates the tile layer.
Expand Down

0 comments on commit f2ef751

Please sign in to comment.