Skip to content

Commit

Permalink
Move killer methods below constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
casperboone committed Apr 23, 2019
1 parent c26492e commit 9ace72e
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions src/main/java/nl/tudelft/jpacman/level/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,6 @@ public class Player extends Unit {
*/
private Unit killer;

/**
* Returns the cause of death.
*
* @return <code>Unit</code> iff the player died by collision.
*/
public Unit getKiller() {
return killer;
}

/**
* Sets the cause of death.
*
* @param killer is set if collision with ghost happens.
*/
public void setKiller(Unit killer) {
this.killer = killer;
}
/**
* Creates a new player with a score of 0 points.
*
Expand Down Expand Up @@ -99,6 +82,24 @@ public void setAlive(boolean isAlive) {
this.killer = null;
}

/**
* Returns the unit that caused the death of Pac-Man.
*
* @return <code>Unit</code> iff the player died by collision, otherwise <code>null</code>.
*/
public Unit getKiller() {
return killer;
}

/**
* Sets the cause of death.
*
* @param killer is set if collision with ghost happens.
*/
public void setKiller(Unit killer) {
this.killer = killer;
}

/**
* Returns the amount of points accumulated by this player.
*
Expand Down

0 comments on commit 9ace72e

Please sign in to comment.