Class EntityVisibilityUtils

java.lang.Object
megamek.common.units.EntityVisibilityUtils

public class EntityVisibilityUtils extends Object
Class containing static functions that perform visibility computations related to an entity without the need to be a part of the Entity class itself.
  • Constructor Details

    • EntityVisibilityUtils

      public EntityVisibilityUtils()
  • Method Details

    • detectedOrHasVisual

      public static boolean detectedOrHasVisual(Player localPlayer, Game game, Entity entity)
      Logic lifted from BoardView1.redrawEntity() that checks whether the given player playing the given game can see the given entity. Takes into account double-blind, hidden units, team vision, etc. Game Master is excluded.
      Parameters:
      localPlayer - The player to check.
      game - The current Game
      entity - The entity to check
      Returns:
      Whether the player can see the entity.
    • onlyDetectedBySensors

      public static boolean onlyDetectedBySensors(@Nullable Player localPlayer, Entity entity)
      Used to determine if this entity is only detected by an enemies sensors and hence should only be a sensor return.
    • trackThisEntitiesVisibilityInfo

      public static boolean trackThisEntitiesVisibilityInfo(Player localPlayer, Entity e)
      We only want to show double-blind visibility indicators on our own meks and teammates meks (assuming team vision option).