20 package net.sf.gridarta.model.gameobject;
22 import java.awt.Point;
23 import javax.swing.Icon;
24 import javax.swing.ImageIcon;
31 import org.jetbrains.annotations.NotNull;
32 import org.jetbrains.annotations.Nullable;
55 public static final String
Z =
"z";
61 public static final String
LAYER =
"layer";
91 public static final String
ALIGN =
"align";
97 public static final String
ZOOM =
"zoom";
103 public static final String
ALPHA =
"alpha";
109 public static final String
ROTATE =
"rotate";
155 private final Point
point =
new Point();
182 return getAttributeInt(IS_TURNABLE) != 0 || getAttributeInt(IS_ANIMATED) != 0;
191 super.setObjectFace();
235 return getAttributeInt(
LAYER) > 1 ? getAttributeInt(
Z) : 0;
247 if (mapSquare ==
null) {
256 if (gameObject.getAttributeInt(
LAYER) == 1 && gameObject.getAttributeInt(
SUB_LAYER) == getAttributeInt(
SUB_LAYER)) {
257 return gameObject.getAttributeInt(
Z);
260 }
catch (
final IndexOutOfBoundsException ignored) {
329 int top = Math.max(wHeight, nwHeight);
330 top = Math.max(top, nHeight);
331 top = Math.max(top, myHeight);
333 int bottom = Math.max(sHeight, seHeight);
334 bottom = Math.max(bottom, eHeight);
335 bottom = Math.max(bottom, myHeight);
337 int right = Math.max(nHeight, neHeight);
338 right = Math.max(right, eHeight);
339 right = Math.max(right, myHeight);
341 int left = Math.max(wHeight, swHeight);
342 left = Math.max(left, sHeight);
343 left = Math.max(left, myHeight);
345 int minHt = Math.min(top, bottom);
346 minHt = Math.min(minHt, left);
347 minHt = Math.min(minHt, right);
348 minHt = Math.min(minHt, myHeight);
350 if (myHeight < 0 && left == 0 && right == 0 && top == 0 && bottom == 0) {
351 int top2 = Math.min(wHeight, nwHeight);
352 top2 = Math.min(top2, nHeight);
353 top2 = Math.min(top2, myHeight);
355 int bottom2 = Math.min(sHeight, seHeight);
356 bottom2 = Math.min(bottom2, eHeight);
357 bottom2 = Math.min(bottom2, myHeight);
359 int right2 = Math.min(nHeight, neHeight);
360 right2 = Math.min(right2, eHeight);
361 right2 = Math.min(right2, myHeight);
363 int left2 = Math.min(wHeight, swHeight);
364 left2 = Math.min(left2, sHeight);
365 left2 = Math.min(left2, myHeight);
368 bottom = bottom2 - bottom;
369 right = right2 - right;
372 minHt = Math.min(top, bottom);
373 minHt = Math.min(minHt, left);
374 minHt = Math.min(minHt, right);
375 minHt = Math.min(minHt, myHeight);
377 minHt = Math.abs(minHt);
379 bottom = Math.abs(bottom);
380 left = Math.abs(left);
381 right = Math.abs(right);
389 top = Math.abs(Math.min(255, top));
390 bottom = Math.abs(Math.min(255, bottom));
391 left = Math.abs(Math.min(255, left));
392 right = Math.abs(Math.min(255, right));
394 stretchFactor = bottom + (left << 8) + (right << 16) + (top << 24);
417 public abstract boolean isDrawDouble(
boolean drawDoubleFaces);
425 public abstract boolean isStretched(
boolean tileStretching);
429 @SuppressWarnings(
"unchecked")
432 return clone.getThis();
437 return super.isEqual(gameObject);
448 super.facesReloaded();