Class PlayerManager


  • public final class PlayerManager
    extends java.lang.Object
    The class which deals with the Players of the Game.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.ArrayList<Survivor> getAliveSurvivors()
      Gets the living (and not escaped) Survivors.
      java.util.Optional<Killer> getKiller()
      Gets the Killer.
      java.util.ArrayList<Survivor> getNotDeadSurvivors()
      Gets the not dead Survivors.
      Survivor getObsession()  
      java.util.ArrayList<org.bukkit.entity.Player> getPlayers()
      Gets a copy of the Players.
      java.util.ArrayList<org.bukkit.entity.Player> getSpectators()
      Gets a copy of the Spectator's list.
      java.util.Optional<Survivor> getSurvivor​(org.bukkit.entity.Player player)
      Gets the Survivor with the specified Player.
      java.util.ArrayList<Survivor> getSurvivors()
      Gets a copy of the Survivors.
      boolean isInGame​(org.bukkit.entity.Player player)
      Checks if the specified Player is in this Game.
      boolean isKiller​(org.bukkit.entity.Player player)
      Determines if the specified Player is the Killer.
      boolean isSpectator​(org.bukkit.entity.Player player)
      Determines if the specified Player is a Spectator.
      void killAliveSurvivors()
      Kills the remaining Survivors.
      void setObsession​(Survivor survivor)
      Sets the Survivor as the Obsession.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isInGame

        public boolean isInGame​(org.bukkit.entity.Player player)
        Checks if the specified Player is in this Game.
        Parameters:
        player - The Player who might be in the Game.
        Returns:
        True if the Player is indeed in this Game.
      • getKiller

        public java.util.Optional<Killer> getKiller()
        Gets the Killer.
        Returns:
        The Killer.
      • getSurvivor

        public java.util.Optional<Survivor> getSurvivor​(org.bukkit.entity.Player player)
        Gets the Survivor with the specified Player.
        Parameters:
        player - The Player who might be a Survivor of this Game.
        Returns:
        The Survivor if the Player is truly a Survivor or null if the Player is not a Survivor of this Game.
      • getPlayers

        public java.util.ArrayList<org.bukkit.entity.Player> getPlayers()
        Gets a copy of the Players.
        Returns:
        A copy of the Players.
      • getSurvivors

        public java.util.ArrayList<Survivor> getSurvivors()
        Gets a copy of the Survivors.
        Returns:
        A copy of the Survivors.
      • isKiller

        public boolean isKiller​(org.bukkit.entity.Player player)
        Determines if the specified Player is the Killer.
        Parameters:
        player - The Player who might be the Killer.
        Returns:
        True if the Player is the Killer.
      • isSpectator

        public boolean isSpectator​(org.bukkit.entity.Player player)
        Determines if the specified Player is a Spectator.
        Parameters:
        player - The Player who might be a Spectator.
        Returns:
        True if the Player is a Spectator.
      • getSpectators

        public java.util.ArrayList<org.bukkit.entity.Player> getSpectators()
        Gets a copy of the Spectator's list.
        Returns:
        A copy of the spectators.
      • getObsession

        public Survivor getObsession()
      • setObsession

        public void setObsession​(Survivor survivor)
        Sets the Survivor as the Obsession.
        Parameters:
        survivor - The Survivor to be set as the Obsession.
      • getNotDeadSurvivors

        public java.util.ArrayList<Survivor> getNotDeadSurvivors()
        Gets the not dead Survivors.
        Returns:
        The List of the Survivors who have not died yet.
      • killAliveSurvivors

        public void killAliveSurvivors()
        Kills the remaining Survivors.
      • getAliveSurvivors

        public java.util.ArrayList<Survivor> getAliveSurvivors()
        Gets the living (and not escaped) Survivors.
        Returns:
        The List of not dead and not escaped Survivors.