20 package net.sf.gridarta.model.validation.checks;
22 import java.awt.Point;
29 import org.jetbrains.annotations.NotNull;
49 final Size2D mapSize = mapModel.getMapArchObject().getMapSize();
50 final int width = mapSize.
getWidth();
52 blocked =
new boolean[width][height];
53 final Point pos =
new Point();
54 for (pos.y = 0; pos.y < height; pos.y++) {
55 for (pos.x = 0; pos.x < width; pos.x++) {
58 blocked[pos.x][pos.y] =
true;
72 public boolean isBlocked(
final int x,
final int y) {
75 }
catch (
final IndexOutOfBoundsException ignored) {
A MapModel reflects the data of a map.
BlockedMatrix(@NotNull final MapModel< G, A, R > mapModel)
Creates a new instance.
String NO_PASS
The name of the "no_pass" attribute.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
final boolean [][] blocked
The blocked grid of the currently processed map:
GameObjects are the objects based on Archetypes found on maps.
int getWidth()
Returns the width of the area.
Determines whether a map square is blocked.
int getHeight()
Returns the height of the area.
boolean isBlocked(final int x, final int y)
Returns whether a given location is blocked.
Interface for MapArchObjects.
The class Size2D represents a 2d rectangular area.