diff --git a/README.md b/README.md index 4486021..0a38fc3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ In this game you find yourself under five others on a night train to Budapest. O If you are playing as a human your task is it to find the menacing creature that is turning everybody so you can safely reach your destiny in human form. -If you are playing as a ghost u aim to turn all humans into your peers and hide the original ghost's identity. +If you are playing as a ghost you aim to turn all humans into your peers and hide the original ghost's identity. Votes are held in the night for the ghosts to decide who will be next and during the day for the humans to decide who they think the ghost is. diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostPlayer.java b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostPlayer.java index 3ee1b9c..944c360 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostPlayer.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/GhostPlayer.java @@ -19,11 +19,12 @@ public class GhostPlayer extends Ghost{ isPlayer = true; kickedOff = false; if (name == null) { - this.name = "Human Nr. " + position; + this.name = "Player Nr. " + position; } else this.name = name; } + public void send(String msg) { - //todo: pass message along to client. + //todo(Jonas): pass message along to client. } } diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanNPC.java b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanNPC.java index 87c47cd..ecb8543 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanNPC.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanNPC.java @@ -1,5 +1,20 @@ package ch.unibas.dmi.dbis.cs108.Klassenstruktur; public class HumanNPC extends Human { - + /** + * Creates a new GhostNPC. Should be used at game start or if a HumanNPC is turned into a ghost. + * @param position position on the train + * @param name player name. if null, then a default name is used. + * + */ + public HumanNPC(int position, String name) { + this.position = position; + this.sock = null; + isGhost = false; + isPlayer = false; + kickedOff = false; + if (name == null) { + this.name = "Robot Nr. " + position; + } else this.name = name; + } } diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanPlayer.java b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanPlayer.java index f968ac9..836d5b7 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanPlayer.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/Klassenstruktur/HumanPlayer.java @@ -1,4 +1,24 @@ package ch.unibas.dmi.dbis.cs108.Klassenstruktur; +import java.net.Socket; + public class HumanPlayer extends Human{ + /** + * Creates a new GhostPlayer. Should be used at game start or if a HumanPlayer is turned into a ghost. + * @param position position on the train + * @param name name. if null, then a default name is used. + * @param sock the socket for the player. + */ + public HumanPlayer(int position, String name, Socket sock, boolean isOG) { + this.position = position; + this.sock = sock; + isGhost = false; + isPlayer = true; + kickedOff = false; + if (name == null) { + this.name = "Player Nr. " + position; + } else this.name = name; + } + + } diff --git a/Übung/TetsBanner.jpg b/Übung/TetsBanner.jpg deleted file mode 100644 index c47fb61..0000000 Binary files a/Übung/TetsBanner.jpg and /dev/null differ