Added an array full of Passengers, set them all to human by default

This commit is contained in:
Seraina
2022-03-25 17:25:05 +01:00
parent a6ca3da263
commit ce250f638d
4 changed files with 69 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ import ch.unibas.dmi.dbis.cs108.Multiplayer.Server.ClientHandler;
import java.net.Socket;
public class Passenger {
protected int position; //the player's Cabin number (1 to 6)
protected int position; //the player's Cabin number (0 to 5)
protected String name; //the player's Name
protected Boolean isGhost; //boolean regarding if the player is a ghost. Could probably be removed since ghost is a subclass but I'm keeping it in.
protected Boolean isPlayer; //same here
@@ -20,6 +20,14 @@ public class Passenger {
//todo: send protocol message to the respective client OR process messages for NPCS
}
/**
* sets the Position of this passenger
* @param position the position of this passenger
*/
public void setPosition(int position) {
this.position = position;
}
/**
* sets the name of this passenger.
* @param name the new name for this passenger.