Skip to content

Commit 3c4a00d

Browse files
committed
update indent
1 parent f13d9ab commit 3c4a00d

File tree

6 files changed

+31
-20
lines changed

6 files changed

+31
-20
lines changed

src/ch/epfl/chacun/ActionEncoder.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public final class ActionEncoder {
5252
* The length of a Base32-encoded action where an occupant is removed.
5353
*/
5454
private static final int WITH_OCCUPANT_REMOVED_ACTION_LENGTH = 1;
55+
5556
/**
5657
* This class can not be instantiated.
5758
*/
@@ -73,6 +74,7 @@ private static List<Pos> fringeIndexes(GameState gameState) {
7374

7475
/**
7576
* Creates a new list of occupants sorted by their zone ID
77+
*
7678
* @param gameState the game state to get the occupants from
7779
* @return the list of occupants sorted by their zone ID
7880
*/
@@ -221,13 +223,15 @@ public static StateAction decodeAndApply(GameState gameState, String action) {
221223
* @param gameState the game state
222224
* @param action the action
223225
*/
224-
public record StateAction(GameState gameState, String action) {}
226+
public record StateAction(GameState gameState, String action) {
227+
}
225228

226229
/**
227230
* An exception to be thrown when an action is invalid for the given game state.
228231
*
229232
* @author Valerio De Santis (373247)
230233
* @author Simon Lefort (371918)
231234
*/
232-
private static class IllegalActionException extends Exception {}
235+
private static class IllegalActionException extends Exception {
236+
}
233237
}

src/ch/epfl/chacun/Board.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ public Board withoutGatherersOrFishersIn(Set<Area<Zone.Forest>> forests, Set<Are
453453
if (placedTile.occupant() != null && placedTile.occupant().kind() == Occupant.Kind.PAWN) {
454454
Occupant occupant = placedTile.occupant();
455455
Zone occupiedZone = placedTile.zoneWithId(occupant.zoneId());
456-
if (occupiedZone instanceof Zone.Forest forest && (forests.contains(forestArea(forest))))
456+
if (occupiedZone instanceof Zone.Forest forest && forests.contains(forestArea(forest)))
457457
newPlacedTiles[index] = placedTile.withNoOccupant();
458458
else if (occupiedZone instanceof Zone.River river && rivers.contains(riverArea(river)))
459459
newPlacedTiles[index] = placedTile.withNoOccupant();

src/ch/epfl/chacun/TextMakerFr.java

+13-6
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public TextMakerFr(Map<PlayerColor, String> names) {
7676
/**
7777
* Creates a string representing the given game item in the given count,
7878
* according to the French language
79-
* @param item the game item, should have a French name whose plural is regular
79+
*
80+
* @param item the game item, should have a French name whose plural is regular
8081
* @param count the count of the game item, if it indicates a plural quantity, the item name will be pluralized
8182
* @return a string representing the given game item in the given count
8283
*/
@@ -87,6 +88,7 @@ private String pluralizeGameItems(GameItem item, int count) {
8788
/**
8889
* Takes an ordered list, and returns a string representing the items in the list
8990
* in a human-readable way
91+
*
9092
* @param items an ordered list of items
9193
* @return a string representing the items in the list in a human-readable way
9294
*/
@@ -109,6 +111,7 @@ private String itemsToString(List<String> items) {
109111
/**
110112
* Orders the given set of player colors and returns a string representing them, telling they earned (some points)
111113
* Example: Alice, Edgar et Bruno ont remporté (X points en tant qu'occupant-e-s majoritaires)
114+
*
112115
* @param scorers the set of player colors that scored
113116
*/
114117
private String earnMessage(Set<PlayerColor> scorers) {
@@ -128,8 +131,9 @@ private String earnMessage(Set<PlayerColor> scorers) {
128131

129132
/**
130133
* Returns a string representing the given set of player colors and the given points
134+
*
131135
* @param scorers the set of player colors that scored
132-
* @param points the points they scored
136+
* @param points the points they scored
133137
* @return a string representing the given set of player colors and the given points
134138
*/
135139
private String earnMessagePoints(Set<PlayerColor> scorers, int points) {
@@ -141,10 +145,11 @@ private String earnMessagePoints(Set<PlayerColor> scorers, int points) {
141145
/**
142146
* Returns a string representing the given set of player colors and the given points,
143147
* telling they earned the points as majority occupants
148+
*
144149
* @param scorers the set of player colors that scored
145-
* @param points the points they scored
150+
* @param points the points they scored
146151
* @return a string representing the given set of player colors and the given points,
147-
* telling they earned the points as majority occupants
152+
* telling they earned the points as majority occupants
148153
*/
149154
private String earnMessageMajorityOccupants(Set<PlayerColor> scorers, int points) {
150155
Preconditions.checkArgument(!scorers.isEmpty());
@@ -162,7 +167,8 @@ private String earnMessageMajorityOccupants(Set<PlayerColor> scorers, int points
162167
/**
163168
* Pluralizes the given word if the count is greater than 1,
164169
* according to the French language. The word has to be a regular one in French
165-
* @param word it has to be a French regular word
170+
*
171+
* @param word it has to be a French regular word
166172
* @param count the count of the word
167173
* @return the pluralized word if the count is greater than 1, the word otherwise
168174
*/
@@ -172,6 +178,7 @@ private String pluralize(String word, int count) {
172178

173179
/**
174180
* Returns a string representing the given map of animals and their counts
181+
*
175182
* @param animals the map of animals to represent as a string
176183
* @return a string representing the given map of animals and their counts
177184
*/
@@ -188,7 +195,7 @@ private String animalsToString(Map<Animal.Kind, Integer> animals) {
188195
return itemsToString(animalsList);
189196
}
190197

191-
198+
192199
@Override
193200
public String playerName(PlayerColor playerColor) {
194201
Preconditions.checkArgument(names.containsKey(playerColor));

src/ch/epfl/chacun/gui/ImageLoader.java

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package ch.epfl.chacun.gui;
22

33
import javafx.scene.image.Image;
4-
import javafx.scene.image.WritableImage;
5-
import javafx.scene.paint.Color;
64

75
import java.util.FormatProcessor;
86

src/ch/epfl/chacun/gui/Main.java

+9-7
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public static void main(String[] args) {
6262
* @param stateAction the state action to save
6363
* @param gameStateO the observable game state
6464
* @param actionsO the observable list of all actions since the start of the game
65-
*
66-
* Note: can also be used to dispatch the action to the server when the game is played online
65+
* <p>
66+
* Note: can also be used to dispatch the action to the server when the game is played online
6767
*/
6868
private void saveState(
6969
ActionEncoder.StateAction stateAction,
@@ -94,7 +94,7 @@ private TileDecks getShuffledTileDecks(Long seed) {
9494
// we make it possible to play without menhir tiles. On the other hand,
9595
// playing without normal tiles is not permitted
9696
List<Tile> menhirTiles = groupedTiles.getOrDefault(Tile.Kind.MENHIR, List.of());
97-
97+
9898
return new TileDecks(
9999
groupedTiles.get(Tile.Kind.START),
100100
groupedTiles.get(Tile.Kind.NORMAL),
@@ -104,10 +104,11 @@ private TileDecks getShuffledTileDecks(Long seed) {
104104

105105
/**
106106
* Starts the ChaCuN game, creating the graphical nodes representing its components
107+
*
107108
* @param primaryStage the primary stage for this application, onto which
108-
* the application scene can be set.
109-
* Applications may create other stages, if needed, but they will not be
110-
* primary stages.
109+
* the application scene can be set.
110+
* Applications may create other stages, if needed, but they will not be
111+
* primary stages.
111112
*/
112113
@Override
113114
public void start(Stage primaryStage) {
@@ -178,7 +179,8 @@ public void start(Stage primaryStage) {
178179
// we update the state of the game and the list of actions
179180
saveState(ActionEncoder.withOccupantRemoved(currentGameState, occupant), gameStateO, actionsO);
180181
}
181-
default -> {}
182+
default -> {
183+
}
182184
}
183185
};
184186
// the rotation of the next tile to place

src/ch/epfl/chacun/gui/PlayersUI.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public static Node create(ObservableValue<GameState> gameStateO, TextMaker textM
7979
Circle circle = new Circle(PLAYER_CIRCLE_RADIUS, ColorMap.fillColor(playerColor));
8080

8181
ObservableValue<String> pointsTextO = pointsO.map(points ->
82-
STR." \{name} : \{textMaker.points(points.getOrDefault(playerColor, 0))}\n"
82+
STR." \{name} : \{textMaker.points(points.getOrDefault(playerColor, 0))}\n"
8383
);
8484

8585
Text pointsText = new Text();
@@ -104,7 +104,7 @@ public static Node create(ObservableValue<GameState> gameStateO, TextMaker textM
104104
*
105105
* @param playerColor the color of the player owning this list of occupants
106106
* @param kind the kind of the occupants to represent
107-
* @param gameStateO the observable current state of a game
107+
* @param gameStateO the observable current state of a game
108108
* @return a list of nodes representing each the occupants of a player,
109109
* with the opacity of each node bound to the number of used and available occupants
110110
*/

0 commit comments

Comments
 (0)