Class BlockedSquareChecker<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.model.validation.AbstractValidator<G,A,R>
-
- net.sf.gridarta.model.validation.checks.BlockedSquareChecker<G,A,R>
-
- All Implemented Interfaces:
MapValidator<G,A,R>,Validator<G,A,R>
public class BlockedSquareChecker<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends AbstractValidator<G,A,R> implements MapValidator<G,A,R>
AMapValidatorto assert that a square that's blocked and no_pass is not surrounded by blocked and no_pass only.- Fixme:
- this implementation does not take care of multi square objects.
-
-
Constructor Summary
Constructors Constructor Description BlockedSquareChecker(@NotNull ValidatorPreferences validatorPreferences)Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
java.lang.Iterable<MapSquare<G,A,R>>findCompletelyBlockedSquares(@NotNull MapModel<G,A,R> mapModel)Returns the completely blocked squares of a map.voidvalidateMap(@NotNull MapModel<G,A,R> mapModel, @NotNull ErrorCollector<G,A,R> errorCollector)Validate a map.-
Methods inherited from class net.sf.gridarta.model.validation.AbstractValidator
getKey, isDefaultEnabled, isEnabled, setEnabled
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sf.gridarta.model.validation.Validator
getKey, isDefaultEnabled, isEnabled, setEnabled
-
-
-
-
Constructor Detail
-
BlockedSquareChecker
public BlockedSquareChecker(@NotNull @NotNull ValidatorPreferences validatorPreferences)Creates a new instance.- Parameters:
validatorPreferences- the validator preferences to use
-
-
Method Detail
-
validateMap
public void validateMap(@NotNull @NotNull MapModel<G,A,R> mapModel, @NotNull @NotNull ErrorCollector<G,A,R> errorCollector)Description copied from interface:MapValidatorValidate a map.- Specified by:
validateMapin interfaceMapValidator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
mapModel- Map to validateerrorCollector- Error collector to report errors to
-
findCompletelyBlockedSquares
public static <G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> java.lang.Iterable<MapSquare<G,A,R>> findCompletelyBlockedSquares(@NotNull @NotNull MapModel<G,A,R> mapModel)
Returns the completely blocked squares of a map.- Parameters:
mapModel- Map Model to search for completely blocked squares- Returns:
- list with all completely blocked squares
-
-