Added possibility to change player from human to ghost

This commit is contained in:
Alexander Sazonov 2022-04-01 11:28:46 +02:00
parent 3151cd4c51
commit 5b3af54720
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,14 @@
package ch.unibas.dmi.dbis.cs108.gamelogic;
import ch.unibas.dmi.dbis.cs108.gamelogic.klassenstruktur.Passenger;
public class GhostifyHandler {
/**
* Changes passenger at position x to ghost
* @param p
* Passenger to be ghostified
*/
public void ghostify(Passenger p) {
p.setGhost();
}
}

View File

@ -52,6 +52,11 @@ public class Passenger {
this.kickedOff = kickedOff;
}
public void setGhost() {
// changes this passenger's status from human to ghost
isGhost = true;
}
public int getPosition() {
return position;
}