Class ModifierCollection

java.lang.Object
me.nabdev.pathfinding.modifiers.ModifierCollection

public class ModifierCollection extends Object
Represents all the modifiers added to a single obstacle
  • Constructor Details

    • ModifierCollection

      public ModifierCollection(org.json.JSONArray modifiers)
      Create a new modifer collection and apply the given modifiers
      Parameters:
      modifiers - The modifiers to apply
  • Method Details

    • hasModifier

      public boolean hasModifier(ObstacleModifier.ObstacleModifierTypes modifierType)
      Get whether or not this modifier collection has a specific obstacle modifier
      Parameters:
      modifierType - The modifier type to check
      Returns:
      true if the given modifier is present
    • invalidateCache

      public void invalidateCache()
      Command a re-calculation for if the obstacle is active or not.
    • isActive

      public boolean isActive()
      Whether or not the obstacle is active right now based on the modifiers
      Returns:
      true if the obstacle is active