Class ECMInfo

java.lang.Object
megamek.common.ECMInfo

public class ECMInfo extends Object
A class that keeps track of information related to an ECM field.
  • Constructor Details

    • ECMInfo

      public ECMInfo()
    • ECMInfo

      public ECMInfo(int range, double strength, Player o, Coords p)
    • ECMInfo

      public ECMInfo(int range, double strength, Entity e)
    • ECMInfo

      public ECMInfo(int range, Coords pos, Player owner, double strength, int angelStrength)
    • ECMInfo

      public ECMInfo(ECMInfo other)
    • ECMInfo

      public ECMInfo(int range, Coords position, double strength)
      Parameters:
      range - Range of ECM
      position - Coords for center
      strength - Strength of ECM
  • Method Details

    • isAngel

      public boolean isAngel()
    • isECCM

      public boolean isECCM()
      Returns:
      true if this ECMInfo is considered to be ECCM; that is, if the strength of ECCM is greater than the strength of ECCM.
    • isAngelECCM

      public boolean isAngelECCM()
    • isECM

      public boolean isECM()
      Returns:
      True if the number of ECM fields is greater than the number of ECCM fields (which default to 0).
    • isAngelECM

      public boolean isAngelECM()
    • addOpposingECMEffects

      public void addOpposingECMEffects(ECMInfo other)
      Compute the ECMInfo from another instance into this one, where this ECMInfo contains information about fields opposed to the owner. All enemy ECM strength is added, and all allied ECCM strength is added.
      Parameters:
      other - Other ECMInfo Instance
    • addAlliedECMEffects

      public void addAlliedECMEffects(ECMInfo other)
      Compute the ECMInfo from another instance into this one, where this ECMInfo contains information about fields allied to the owner. All allied ECM strength is added, and all enemy ECCM strength is added.
      Parameters:
      other - Other ECMInfo Instance
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isOpposed

      public boolean isOpposed(ECMInfo other)
      Parameters:
      other - Other ECMInfo Instance
      Returns:
      true if the supplied ECMInfo is opposed to this one.
    • isOpposed

      public boolean isOpposed(Player other)
      Parameters:
      other - Other ECMInfo Instance
      Returns:
      true if the supplied ECMInfo is opposed to this one.
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
      Parameters:
      object - Other Object to compare to.
      Returns:
      Equality is based on whether position, owner, range and all strengths match.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getRange

      public int getRange()
    • setRange

      public void setRange(int range)
    • getPos

      public Coords getPos()
    • setPos

      public void setPos(Coords pos)
    • getOwner

      public Player getOwner()
    • setOwner

      public void setOwner(Player owner)
    • getECMStrength

      public double getECMStrength()
    • getAngelECMStrength

      public int getAngelECMStrength()
    • setAngelECMStrength

      public void setAngelECMStrength(int angelStrength)
    • getECCMStrength

      public int getECCMStrength()
    • setECCMStrength

      public void setECCMStrength(int eccmStrength)
    • getAngelECCMStrength

      public int getAngelECCMStrength()
    • setAngelECCMStrength

      public void setAngelECCMStrength(int angelECCMStrength)
    • getDirection

      public int getDirection()
    • setDirection

      public void setDirection(int direction)
    • isNovaECM

      public boolean isNovaECM()
    • isNova

      public boolean isNova()
    • setECMNova

      public void setECMNova(boolean isECMNova)
    • getEntity

      public Entity getEntity()
    • setEntity

      public void setEntity(Entity owningEntity)