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>
GameObjectValidator
that 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 and Description |
---|
EnvironmentChecker(@NotNull ValidatorPreferences validatorPreferences)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addInv(@NotNull ArchetypeType archetypeType,
int[] types)
Sets the allowed environment game object types for an
ArchetypeType . |
void |
addNoMap(@NotNull ArchetypeType archetypeType)
Marks an
ArchetypeType to not be allowed directly on maps. |
void |
validateGameObject(G gameObject,
@NotNull ErrorCollector<G,A,R> errorCollector)
Validates a game object.
|
getKey, isDefaultEnabled, isEnabled, setEnabled
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getKey, isDefaultEnabled, isEnabled, setEnabled
public EnvironmentChecker(@NotNull @NotNull ValidatorPreferences validatorPreferences)
validatorPreferences
- the validator preferences to usepublic void addNoMap(@NotNull @NotNull ArchetypeType archetypeType)
ArchetypeType
to not be allowed directly on maps.archetypeType
- the archetype typepublic void addInv(@NotNull @NotNull ArchetypeType archetypeType, int[] types)
ArchetypeType
.archetypeType
- the archetype typetypes
- the allowed environment typespublic void validateGameObject(@NotNull G gameObject, @NotNull @NotNull ErrorCollector<G,A,R> errorCollector)
GameObjectValidator
validateGameObject
in interface GameObjectValidator<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
gameObject
- the game object to validateerrorCollector
- the error collector to report errors to