Package me.nabdev.pathfinding.modifiers
Class ModifierCollection
java.lang.Object
me.nabdev.pathfinding.modifiers.ModifierCollection
Represents all the modifiers added to a single obstacle
-
Constructor Summary
ConstructorsConstructorDescriptionModifierCollection(org.json.JSONArray modifiers) Create a new modifer collection and apply the given modifiers -
Method Summary
Modifier and TypeMethodDescriptionbooleanhasModifier(ObstacleModifier.ObstacleModifierTypes modifierType) Get whether or not this modifier collection has a specific obstacle modifiervoidCommand a re-calculation for if the obstacle is active or not.booleanisActive()Whether or not the obstacle is active right now based on the modifiers
-
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
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
-