Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kuronekochomusuke committed Nov 10, 2024
1 parent 9eedda5 commit d71ea43
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions megamek/src/megamek/utilities/BoardClassifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
package megamek.utilities;

import java.io.File;
import java.util.ArrayList;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;

import megamek.common.Board;
Expand Down Expand Up @@ -153,14 +149,16 @@ private void scanForBoardsInDir(final File boardDir, final String basePath) {
getBoardsByHeight().get(dimension.height()).add(filePath.getPath());
getBoardsByWidth().get(dimension.width()).add(filePath.getPath());

for (String tagString : Board.getTags(filePath)) {
Set<String> boardTags = Board.getTags(filePath);

for (String tagString : boardTags) {
Tags tag = Tags.parse(tagString);
getBoardsByTag().putIfAbsent(tag, new ArrayList<>());
getBoardsByTag().get(tag).add(filePath.getPath());
}

getBoardPaths().put(filePath.getPath(), partialBoardPath);
getBoardTags().put(filePath.getPath(), Board.getTags(filePath).toString());
getBoardTags().put(filePath.getPath(), boardTags.toString());
getBoardWidth().put(filePath.getPath(), dimension.width());
getBoardHeigth().put(filePath.getPath(), dimension.height());
}
Expand Down

0 comments on commit d71ea43

Please sign in to comment.