small adjustments & comments to passenger & subclasses
This commit is contained in:
parent
f2c1cbc17c
commit
166dc5151b
@ -13,7 +13,7 @@ public class GhostNPC extends Ghost{
|
||||
this.position = position;
|
||||
this.sock = null;
|
||||
isGhost = true;
|
||||
isPlayerCharacter = false;
|
||||
isPlayer = false;
|
||||
kickedOff = false;
|
||||
if (name == null) {
|
||||
this.name = "Robot Nr. " + position;
|
||||
|
||||
@ -16,10 +16,14 @@ public class GhostPlayer extends Ghost{
|
||||
this.sock = sock;
|
||||
this.isOG = isOG;
|
||||
isGhost = true;
|
||||
isPlayerCharacter = true;
|
||||
isPlayer = true;
|
||||
kickedOff = false;
|
||||
if (name == null) {
|
||||
this.name = "Human Nr. " + position;
|
||||
} else this.name = name;
|
||||
}
|
||||
|
||||
public void send(String msg) {
|
||||
//todo: pass message along to client.
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,9 +6,10 @@ public class Passenger {
|
||||
protected int position; //the player's Cabin number (1 to 6)
|
||||
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 isPlayerCharacter; //same here
|
||||
protected Boolean isPlayer; //same here
|
||||
protected Boolean kickedOff; //true if the player has been voted off.
|
||||
protected Socket sock; //the socket for the client associated with this Passenger, for NPCs, this can be null.
|
||||
//todo: maybe this should be a thread or some class instead of a socket? depends on client-server structure...
|
||||
|
||||
|
||||
/**
|
||||
@ -16,7 +17,7 @@ public class Passenger {
|
||||
* @param msg the message that is sent to this player.
|
||||
**/
|
||||
public void send(String msg) {
|
||||
//todo: send protocol message to the respective client
|
||||
//todo: send protocol message to the respective client OR process messages for NPCS
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,7 +52,7 @@ public class Passenger {
|
||||
return kickedOff;
|
||||
}
|
||||
|
||||
public Boolean getPlayerCharacter() {
|
||||
return isPlayerCharacter;
|
||||
public Boolean getIsPlayer() {
|
||||
return isPlayer;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user