Class AuraManager


  • public final class AuraManager
    extends java.lang.Object
    Deals with the Players' Auras. Every PerkUser has an Aura object that determines who they can see, so in a sense the PerkUsers know who they see, not the other way around. A PerkUser sees a Player's Aura if every AuraRecord whose Player is equal to the same Player is true. If only even one AuraRecord is false, the PerkUser is unable to see the Player's Aura. (Player's Aura = The Player having a Glowing Potion Effect in the eyes of the PerkUser.)
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAuraGlobally​(org.bukkit.entity.Entity entity, Perk perk, boolean value)
      Adds an AuraRecord for every Survivor and the Killer.
      void addAuraToPlayer​(PerkUser see, org.bukkit.entity.Entity entity, Perk perk, boolean value)
      Adds an AuraRecord to the PerkUser's Aura.
      void addAuraToSurvivors​(org.bukkit.entity.Entity entity, Perk perk, boolean value)
      Adds an AuraRecord to every Survivor.
      void clear()
      Sets every Player's visibility to false.
      void removeAuraByEntity​(PerkUser see, org.bukkit.entity.Entity entity)  
      void removeAuraByPerk​(PerkUser see, Perk perk)  
      void removeAuraFromPlayer​(PerkUser see, org.bukkit.entity.Entity entity, Perk perk)
      Removes the AuraRecord that was set by the specified Perk.
      void removeAuraFromSurvivors​(org.bukkit.entity.Entity entity, Perk perk)
      Removes the AuraRecord from every Survivor.
      void removeAuraGlobally​(org.bukkit.entity.Entity entity, Perk perk)
      Removes an AuraRecord from every Survivor and the Killer.
      void update()
      Refreshes every Player's visibility for every Survivor and Killer.
      • Methods inherited from class java.lang.Object

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

      • addAuraToPlayer

        public void addAuraToPlayer​(PerkUser see,
                                    org.bukkit.entity.Entity entity,
                                    Perk perk,
                                    boolean value)
        Adds an AuraRecord to the PerkUser's Aura.
        Parameters:
        see - The PerkUser who wishes to see (or to not see) the Player.
        entity - The Player who will (or will not) be visible to the PerkUser.
        perk - The Perk which created the AuraRecord.
        value - True, if the PerkUser should see the Player.
      • removeAuraFromPlayer

        public void removeAuraFromPlayer​(PerkUser see,
                                         org.bukkit.entity.Entity entity,
                                         Perk perk)
        Removes the AuraRecord that was set by the specified Perk.
        Parameters:
        see - The PerkUser whose Aura should be changed.
        entity - The Player who will (or will not) be visible to the PerkUser.
        perk - The Perk which created the AuraRecord.
      • addAuraToSurvivors

        public void addAuraToSurvivors​(org.bukkit.entity.Entity entity,
                                       Perk perk,
                                       boolean value)
        Adds an AuraRecord to every Survivor.
        Parameters:
        entity - The Player who will (or will not) be visible to the Survivors.
        perk - The Perk which created the AuraRecord.
        value - True, if the Survivors should see the Player.
      • removeAuraFromSurvivors

        public void removeAuraFromSurvivors​(org.bukkit.entity.Entity entity,
                                            Perk perk)
        Removes the AuraRecord from every Survivor.
        Parameters:
        entity - The Player who will (or will not) be visible to the Survivors.
        perk - The Perk which created the AuraRecord.
      • addAuraGlobally

        public void addAuraGlobally​(org.bukkit.entity.Entity entity,
                                    Perk perk,
                                    boolean value)
        Adds an AuraRecord for every Survivor and the Killer.
        Parameters:
        entity - The Player who will (or will not) be visible to the Survivors and the Killer.
        perk - The Perk which created the AuraRecord.
        value - True, if the Survivors and the Killer should see the Player.
      • removeAuraGlobally

        public void removeAuraGlobally​(org.bukkit.entity.Entity entity,
                                       Perk perk)
        Removes an AuraRecord from every Survivor and the Killer.
        Parameters:
        entity - The Player who will (or will not) be visible to the Survivors and the Killer.
        perk - The Perk which created the AuraRecord.
      • removeAuraByPerk

        public void removeAuraByPerk​(PerkUser see,
                                     Perk perk)
      • removeAuraByEntity

        public void removeAuraByEntity​(PerkUser see,
                                       org.bukkit.entity.Entity entity)
      • update

        public void update()
        Refreshes every Player's visibility for every Survivor and Killer.
      • clear

        public void clear()
        Sets every Player's visibility to false. However, the AuraRecords won't be deleted so if they still exist, their visibility will be set to true again when the update() method is called, or when a change occurs to the AuraRecords.