20 package net.sf.gridarta.model.validation.checks;
22 import java.util.Arrays;
23 import java.util.Collection;
24 import java.util.HashSet;
33 import org.jetbrains.annotations.NotNull;
39 public class EmptySpawnPointChecker<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> {
45 private final Collection<Integer>
typeNumbers =
new HashSet<>();
53 super(validatorPreferences);
54 this.typeNumbers.addAll(Arrays.asList(typeNumbers));
59 if (typeNumbers.contains(gameObject.getTypeNo())) {
60 if (gameObject.isEmpty()) {
EmptySpawnPointChecker(@NotNull final ValidatorPreferences validatorPreferences, @NotNull final Integer... typeNumbers)
Create a new instance.
This is the base class for validators.
Interface for GameObject Validators.
This package contains the framework for validating maps.
void validateGameObject(@NotNull final G gameObject, @NotNull final ErrorCollector< G, A, R > errorCollector)
Validates a game object.
final Collection< Integer > typeNumbers
The object types to check.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
Validation error that's used when the EmptySpawnPointChecker detected a possible error on the map...
Configuration parameters for Validators.
GameObjects are the objects based on Archetypes found on maps.
An GameObjectValidator to assert that spawn points are not empty.
final ValidatorPreferences validatorPreferences
The ValidatorPreferences to use.
An interface for classes that collect errors.
Interface for MapArchObjects.