 |
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;
40 public abstract class AbstractShopSquareChecker<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> {
58 final Size2D mapSize = mapModel.getMapArchObject().getMapSize();
59 final int mapWidth = mapSize.
getWidth();
60 final int mapHeight = mapSize.
getHeight();
61 final boolean[][] matchingSquares =
new boolean[mapWidth][mapHeight];
62 final Point point =
new Point();
63 for (point.x = 0; point.x < mapWidth; point.x++) {
64 for (point.y = 0; point.y < mapHeight; point.y++) {
65 matchingSquares[point.x][point.y] =
isMatching(mapModel.getMapSquare(point), matcher);
68 return matchingSquares;
80 if (matcher.isMatching(gameObject.getHead())) {
int getWidth()
Returns the width of the area.
A MapModel reflects the data of a map.
Base package of all Gridarta classes.
Interface for classes that match GameObjects.
Reflects a game object (object on a map).
final ValidatorPreferences validatorPreferences
The ValidatorPreferences to use.
AbstractShopSquareChecker(@NotNull final ValidatorPreferences validatorPreferences)
Creates a new instance.
Interface for Map Validators.
Configuration parameters for Validators.
GameObjects are the objects based on Archetypes found on maps.
int getHeight()
Returns the height of the area.
Classes related to matching {GameObjects}, so called { net.sf.gridarta.model.match....
Interface for MapArchObjects.
This is the base class for validators.
boolean isMatching(@NotNull final Iterable< G > mapSquare, @NotNull final GameObjectMatcher matcher)
Returns whether a map square contains a game object matching a given GameObjectMatcher.
This package contains the framework for validating maps.
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.
The class Size2D represents a 2d rectangular area.