 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.validation.checks;
22 import java.awt.Point;
32 import org.jetbrains.annotations.NotNull;
33 import org.jetbrains.annotations.Nullable;
70 super(validatorPreferences);
81 final Point point =
new Point();
82 for (point.x = 0; point.x < shopSquares.length && point.x < noSpellsSquares.length; point.x++) {
83 for (point.y = 0; point.y < shopSquares[point.x].length && point.y < noSpellsSquares[point.x].length; point.y++) {
84 if (shopSquares[point.x][point.y]) {
85 if (!noSpellsSquares[point.x][point.y]) {
104 if (blockedSquares[point.x][point.y]) {
108 for (
int dx = -1; dx <= +1; dx++) {
109 for (
int dy = -1; dy <= +1; dy++) {
110 final int x = point.x + dx;
111 final int y = point.y + dy;
114 if (!noSpellsSquares[x][y] && !blockedSquares[x][y]) {
117 }
catch (
final ArrayIndexOutOfBoundsException ignored) {
A MapModel reflects the data of a map.
Base package of all Gridarta classes.
final GameObjectMatcher blockedMatcher
The GameObjectMatcher for finding blocked squares.
Interface for classes that match GameObjects.
Reflects a game object (object on a map).
A SquareValidationError for shop tiles that allow spells or prayers.
Configuration parameters for Validators.
GameObjects are the objects based on Archetypes found on maps.
Classes related to matching {GameObjects}, so called { net.sf.gridarta.model.match....
Interface for MapArchObjects.
A net.sf.gridarta.model.validation.MapValidator to detect shop squares which allow magic or prayers.
An interface for classes that collect errors.
final GameObjectMatcher noSpellsMatcher
The GameObjectMatcher for finding no-spell squares.
This package contains the framework for validating maps.
ShopSquareChecker(@NotNull final ValidatorPreferences validatorPreferences, @NotNull final GameObjectMatcher shopMatcher, @NotNull final GameObjectMatcher noSpellsMatcher, @Nullable final GameObjectMatcher blockedMatcher)
Creates a new instance.
void validateMap(@NotNull final MapModel< G, A, R > mapModel, @NotNull final ErrorCollector< G, A, R > errorCollector)
A SquareValidationError for shop tiles that have an adjacent map square that is not blocked and does ...
A MapValidator to detect shop squares which allow magic or prayers, or which have adjacent squares th...
boolean[][] findMatchingSquares( @NotNull final MapModel< G, A, R > mapModel, @NotNull final GameObjectMatcher matcher)
Returns a.
static boolean hasAdjacentNonBlockedSpellsAllowedSquare(final boolean @NotNull[] @NotNull[] noSpellsSquares, final boolean @NotNull[] @NotNull[] blockedSquares, @NotNull final Point point)
Returns whether a given square is not blocked and has a non-blocked adjacent square that allows spell...
final GameObjectMatcher shopMatcher
The GameObjectMatcher for finding shop squares.