Skip to content

Commit

Permalink
Updated javadoc for movePlayer, and adjusted other methods as well
Browse files Browse the repository at this point in the history
  • Loading branch information
dxiao committed Sep 24, 2012
1 parent e1f7c1c commit e5de457
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Mazebuilder/src/com/mazebuilder/gameplay/board/Board.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ public interface Board extends Renderable {
Location getPlayerLocation(Player p);

/**
* Returns the new location of the given player. Will return true if the move was completed. Does not jump walls. Uses identity (==)
* Will return true if the move was completed. Does not jump walls. Uses identity (==)
* comparisons.
**/
boolean movePlayer(Player p, Direction d);

/**
* Returns the new location of the given player. Will return the same location if the move is impossible. Does not jump walls. Uses identity (==)
* Will return true if the move was completed. Does not jump walls. Uses identity (==)
* comparisons.
**/
Location movePlayerWithBonus(Player p, Direction d);
boolean movePlayerWithBonus(Player p, Direction d);

/**
* Returns the new location of the given player. Will return the same location if the move is impossible (player cannot jump or no wall to jump).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,17 @@ public boolean movePlayer(Player p, Direction d) {
}

@Override
public Location movePlayerWithBonus(Player p, Direction d) {
public boolean movePlayerWithBonus(Player p, Direction d) {
Preconditions.checkArgument(p.canJump(), "Player " + Strings.nullToEmpty(p.getName()) + " cannot jump.");
Location l = getPlayerLocation(p);
if (!walls.isWall(l, d)) {
Location moved = l.move(d);
if (isBoardLocation(moved) && p.spendBonus(d)) {
l = moved;
players.put(p, l);
players.put(p, moved);
return true;
}
}
return l;
return false;
}

@Override
Expand Down

0 comments on commit e5de457

Please sign in to comment.