Klasse ThreatTable

java.lang.Object
de.delinkedde.mobarenareborn.threat.ThreatTable

public final class ThreatTable extends Object
Tracks accumulated threat each player has generated against each mob.

This is pure bookkeeping with no game dependency: it maps a mob id to a per-player threat total and answers which player currently holds the most threat on a mob. The ThreatService turns those answers into mob targeting.

  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    void
    add(@NotNull UUID mob, @NotNull UUID player, double amount)
    Adds threat for a player on a mob.
    void
    Removes all threat records.
    @NotNull Set<UUID>
     
    void
    removeMob(@NotNull UUID mob)
    Removes all threat recorded for a mob.
    void
    removePlayer(@NotNull UUID player)
    Removes a player from every mob's threat record.
    void
    set(@NotNull UUID mob, @NotNull UUID player, double amount)
    Sets a player's threat on a mob to an absolute value (used by taunt).
    @NotNull Optional<UUID>
    top(@NotNull UUID mob)
    Returns the player holding the most threat on a mob.
    int
     

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • ThreatTable

      public ThreatTable()
  • Methodendetails

    • add

      public void add(@NotNull @NotNull UUID mob, @NotNull @NotNull UUID player, double amount)
      Adds threat for a player on a mob.
      Parameter:
      mob - the mob id
      player - the player id
      amount - the threat to add
    • set

      public void set(@NotNull @NotNull UUID mob, @NotNull @NotNull UUID player, double amount)
      Sets a player's threat on a mob to an absolute value (used by taunt).
      Parameter:
      mob - the mob id
      player - the player id
      amount - the threat value to set
    • top

      @NotNull public @NotNull Optional<UUID> top(@NotNull @NotNull UUID mob)
      Returns the player holding the most threat on a mob.
      Parameter:
      mob - the mob id
      Gibt zurück:
      the top-threat player id, or empty if the mob has no threat recorded
    • removeMob

      public void removeMob(@NotNull @NotNull UUID mob)
      Removes all threat recorded for a mob.
      Parameter:
      mob - the mob id
    • removePlayer

      public void removePlayer(@NotNull @NotNull UUID player)
      Removes a player from every mob's threat record.
      Parameter:
      player - the player id
    • trackedMobs

      public int trackedMobs()
      Gibt zurück:
      the number of mobs currently tracked
    • mobs

      @NotNull public @NotNull Set<UUID> mobs()
      Gibt zurück:
      a copy of the currently tracked mob ids
    • clear

      public void clear()
      Removes all threat records.