Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Weebli/OOP20-bomber1 int…
Browse files Browse the repository at this point in the history
…o develop
  • Loading branch information
Fraloha committed Jun 24, 2021
2 parents a898364 + c22034b commit 83ee451
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/main/java/bomberone/model/enemy/EnemyImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public final class EnemyImpl extends MoveableObjectImpl implements Enemy {
private static final int SECONDS_TO_WAIT = 4;

/**
* This constant is the number of frames per second
* This constant is the number of frames per second.
*/
private static final int FRAME_PER_SECOND = 60;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public final class HardBehavior extends AbstractActions {
* Creates a new IntermediateBehavior object.
*
* @param newEnemy The enemy that uses this behavior.
* @param finder
*/
public HardBehavior(final Enemy newEnemy, final PathFinder finder) {
super(newEnemy);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/bomberone/model/pathfinding/BFSSearch.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public final class BFSSearch implements PathFinder {
*
* @param map The game map.
*/
public BFSSearch(GameBoard map) {
public BFSSearch(final GameBoard map) {
this.map = map;
this.exploredNodes = new LinkedList<BoardPoint>();
this.discoveredNodes = new LinkedList<Node>();
Expand All @@ -37,7 +37,7 @@ public BFSSearch(GameBoard map) {
* {@inheritDoc}
*/
@Override
public void setMap(GameBoard newMap) {
public void setMap(final GameBoard newMap) {
this.map = newMap;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public void changeAllItems(final Markers markerToChange, final Markers newMarker
*
* @param points A List<BoardPoint> objects that have to get the marker
* changed.
* @param newMarker The new marker.
*
*/
public void changeAllItems(final List<BoardPoint> points) {
boolean result;
Expand Down
18 changes: 11 additions & 7 deletions src/main/java/bomberone/views/rank/RankViewImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import bomberone.views.ViewType;
import bomberone.views.ViewsSwitcher;
import bomberone.controllers.rank.RankController;
import bomberone.model.match.Difficulty;
import bomberone.model.user.User;
import javafx.scene.image.Image;

Expand All @@ -49,6 +48,11 @@ public final class RankViewImpl extends ViewImpl implements RankView {
*/
private static final int BUTTONS_IMAGES = 2;

/**
* This constant indicates the default selected rank.
*/
private static final int DEFAULT_RANK = 0;

private int currentRank;
private Image[] rankDifficultyImages;
private Image[] imagesPrevButtons;
Expand Down Expand Up @@ -110,14 +114,14 @@ public void init() {
// Setting the initial rank to show.
try {
this.currentRank = ((RankController) this.getController()).getMatchDifficulty().ordinal();
} catch(Exception e) {
this.currentRank = Difficulty.EASY.ordinal();
} catch (Exception e) {
this.currentRank = RankViewImpl.DEFAULT_RANK;
}

this.imageViewDifficulty.setImage(this.rankDifficultyImages[this.currentRank]);
this.tableView.setItems(this.ranks.get(this.currentRank));
}

/**
* {@inheritDoc}
*/
Expand Down Expand Up @@ -286,23 +290,23 @@ public void changeRank(final boolean next) {
this.imageViewDifficulty.setImage(this.rankDifficultyImages[this.currentRank]);
this.tableView.setItems(this.ranks.get(this.currentRank));
}

/**
* {@inheritDoc}
*/
@Override
public void onBackToMainMenuClicked() {
ViewsSwitcher.getInstance().switchView(this.getStage(), ViewType.HOME, this.getController().getModel());
}

/**
* {@inheritDoc}
*/
@Override
public void onNextClicked() {
this.changeRank(true);
}

/**
* {@inheritDoc}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,13 @@ public class TestPathfinding {
*/
private static final int POS_1 = 1;

BoardPoint startPosition;
private BoardPoint startPosition;
private PathFinder pathFinder;
private GameBoard testBoard;

/**
*
*/
@BeforeEach
public void init() {
List<List<String>> boardToSet = new LinkedList<List<String>>();
Expand Down

0 comments on commit 83ee451

Please sign in to comment.