Skip to content

Commit

Permalink
Fix indent some more.
Browse files Browse the repository at this point in the history
  • Loading branch information
riverwanderer committed Nov 29, 2024
1 parent 37726f2 commit f1ccc64
Showing 1 changed file with 47 additions and 47 deletions.
94 changes: 47 additions & 47 deletions vassal-app/src/main/java/VASSAL/counters/PlaceMarker.java
Original file line number Diff line number Diff line change
Expand Up @@ -241,61 +241,61 @@ protected Command placeMarker(boolean clearParentId) {
!Boolean.TRUE.equals(marker.getProperty(Properties.NO_STACK)) &&
!Boolean.TRUE.equals(outer.getProperty(Properties.NO_STACK)) &&
m.getPieceCollection().canMerge(outer, marker)) {
GamePiece target = outer;
int index = -1;
Stack parent = getParent();

if (parent == null) {
// we're not in a stack now, but we will be _after_ the merge
if (placement == STACK_BOTTOM || placement == BELOW) {
index = 0;
}
GamePiece target = outer;
int index = -1;
Stack parent = getParent();

if (parent == null) {
// we're not in a stack now, but we will be _after_ the merge
if (placement == STACK_BOTTOM || placement == BELOW) {
index = 0;
}
else {
// we're in a stack already
switch (placement) {
case STACK_TOP:
target = parent;
break;
case STACK_BOTTOM:
index = 0;
break;
case ABOVE:
break;
case BELOW:
index = parent.indexOf(outer);
}
}
else {
// we're in a stack already
switch (placement) {
case STACK_TOP:
target = parent;
break;
case STACK_BOTTOM:
index = 0;
break;
case ABOVE:
break;
case BELOW:
index = parent.indexOf(outer);
}
}

c = m.getStackMetrics().merge(target, marker);
c = m.getStackMetrics().merge(target, marker);

if (index >= 0) {
// we need to adjust the marker's position in the Stack
if (parent == null) {
// get the newly formed Stack if there hadn't been one before
parent = target.getParent();
}
final ChangeTracker ct = new ChangeTracker(parent);
parent.insert(marker, index);
c = c.append(ct.getChangeCommand());
if (index >= 0) {
// we need to adjust the marker's position in the Stack
if (parent == null) {
// get the newly formed Stack if there hadn't been one before
parent = target.getParent();
}

m.repaint();
final ChangeTracker ct = new ChangeTracker(parent);
parent.insert(marker, index);
c = c.append(ct.getChangeCommand());
}
else if (xOffset == 0 && yOffset == 0 && m.getStackMetrics().isStackingEnabled() && !Boolean.TRUE.equals(marker.getProperty(Properties.NO_STACK))) {
c = m.placeOrMerge(marker, p);
final Stack parent = marker.getParent();
if ((parent != null) && (parent.pieceCount > 1)) {
if ((placement == STACK_BOTTOM) || (placement == BELOW)) {
final ChangeTracker ct = new ChangeTracker(parent);
parent.insert(marker, 0);
c = c.append(ct.getChangeCommand());
}

m.repaint();
}
else if (xOffset == 0 && yOffset == 0 && m.getStackMetrics().isStackingEnabled() && !Boolean.TRUE.equals(marker.getProperty(Properties.NO_STACK))) {
c = m.placeOrMerge(marker, p);
final Stack parent = marker.getParent();
if ((parent != null) && (parent.pieceCount > 1)) {
if ((placement == STACK_BOTTOM) || (placement == BELOW)) {
final ChangeTracker ct = new ChangeTracker(parent);
parent.insert(marker, 0);
c = c.append(ct.getChangeCommand());
}
}
else {
c = m.placeAt(marker, p);
}
}
else {
c = m.placeAt(marker, p);
}

// Set Our ParentID into the markers parent UniqueID. May have been called by Replace, in which case we do not set a parent Id as the parent will be deleted
if (!clearParentId) {
Expand Down

0 comments on commit f1ccc64

Please sign in to comment.