20 package net.sf.gridarta.model.mapmodel;
27 import org.jetbrains.annotations.NotNull;
28 import org.jetbrains.annotations.Nullable;
89 if (floorGameObjectMatcher != null && floorGameObjectMatcher.
isMatching(gameObject)) {
90 replaceFloor(gameObject, mapSquare, mapSquare.getLast(floorGameObjectMatcher));
91 }
else if (wallGameObjectMatcher != null && wallGameObjectMatcher.
isMatching(gameObject) &&
replaceWall(gameObject, mapSquare, mapSquare.getLast(wallGameObjectMatcher))) {
92 }
else if (belowFloorGameObjectMatcher != null && belowFloorGameObjectMatcher.
isMatching(gameObject)) {
93 mapSquare.addFirst(gameObject);
94 }
else if (systemObjectGameObjectMatcher != null && !systemObjectGameObjectMatcher.
isMatching(gameObject)) {
97 mapSquare.addLast(gameObject);
114 if (lastFloor != null && !lastFloor.isMulti()) {
115 mapSquare.replace(lastFloor, gameObject);
120 if (belowFloorGameObjectMatcher != null) {
121 final G lastBelowFloor = mapSquare.getLastOfLeadingSpan(belowFloorGameObjectMatcher);
122 if (lastBelowFloor != null) {
123 mapSquare.insertAfter(lastBelowFloor, gameObject);
129 mapSquare.addFirst(gameObject);
140 if (lastWall != null && !lastWall.isMulti()) {
141 mapSquare.replace(lastWall, gameObject);
156 mapSquare.insertAfter(firstSystemObject, gameObject);
void insert(@NotNull final G gameObject, @NotNull final MapSquare< G, A, R > mapSquare)
static final long serialVersionUID
The serial version UID.
Interface for classes that match GameObjects.
This package contains classes related to matching GameObjects, so called GameObjectMatchers.
final GameObjectMatcher belowFloorGameObjectMatcher
A GameObjectMatcher matching monster game objects.
Base class for classes that contain GameObjects as children in the sense of containment.
final GameObjectMatcher systemObjectGameObjectMatcher
A GameObjectMatcher matching system objects that should stay on top.
void insertNonSystemObject(@NotNull final G gameObject, @NotNull final GameObjectContainer< G, A, R > mapSquare, @Nullable final G firstSystemObject)
Inserts a non-system game object.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
GameObjects are the objects based on Archetypes found on maps.
final GameObjectMatcher floorGameObjectMatcher
A GameObjectMatcher matching floor game objects.
final GameObjectMatcher wallGameObjectMatcher
A GameObjectMatcher matching wall game objects.
void replaceFloor(@NotNull final G gameObject, @NotNull final MapSquare< G, A, R > mapSquare, @Nullable final G lastFloor)
Replace a floor game object.
AutoInsertionMode(@Nullable final GameObjectMatcher floorGameObjectMatcher, @Nullable final GameObjectMatcher wallGameObjectMatcher, @Nullable final GameObjectMatcher belowFloorGameObjectMatcher, @Nullable final GameObjectMatcher systemObjectGameObjectMatcher)
Initializes the class.
Automatically guess the insertion position.
boolean replaceWall(@NotNull final G gameObject, @NotNull final GameObjectContainer< G, A, R > mapSquare, @Nullable final G lastWall)
Replaces a wall game object.
Interface for MapArchObjects.
boolean isMatching(@NotNull GameObject<?, ?, ?> gameObject)
Matches an GameObject.