Class EnvironmentChecker<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.EnvironmentChecker<G,A,R>
-
- All Implemented Interfaces:
GameObjectValidator<G,A,R>,Validator<G,A,R>
public class EnvironmentChecker<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends AbstractValidator<G,A,R> implements GameObjectValidator<G,A,R>
AGameObjectValidatorthat checks for valid environment. Warnings can be generated for game objects placed directly on maps, or for game objects placed into inventories of game objects not having some type.
-
-
Constructor Summary
Constructors Constructor Description EnvironmentChecker(@NotNull ValidatorPreferences validatorPreferences)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddInv(@NotNull ArchetypeType archetypeType, int @NotNull [] types)Sets the allowed environment game object types for anArchetypeType.voidaddNoMap(@NotNull ArchetypeType archetypeType)Marks anArchetypeTypeto not be allowed directly on maps.voidvalidateGameObject(G gameObject, @NotNull ErrorCollector<G,A,R> errorCollector)Validates a game object.-
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
-
EnvironmentChecker
public EnvironmentChecker(@NotNull @NotNull ValidatorPreferences validatorPreferences)Creates a new instance.- Parameters:
validatorPreferences- the validator preferences to use
-
-
Method Detail
-
addNoMap
public void addNoMap(@NotNull @NotNull ArchetypeType archetypeType)Marks anArchetypeTypeto not be allowed directly on maps.- Parameters:
archetypeType- the archetype type
-
addInv
public void addInv(@NotNull @NotNull ArchetypeType archetypeType, int @NotNull [] types)Sets the allowed environment game object types for anArchetypeType.- Parameters:
archetypeType- the archetype typetypes- the allowed environment types
-
validateGameObject
public void validateGameObject(@NotNull G gameObject, @NotNull @NotNull ErrorCollector<G,A,R> errorCollector)Description copied from interface:GameObjectValidatorValidates a game object.- Specified by:
validateGameObjectin interfaceGameObjectValidator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
gameObject- the game object to validateerrorCollector- the error collector to report errors to
-
-