fixed bug when deleting tiles

This commit is contained in:
Stephan Richter
2020-12-04 15:20:31 +01:00
parent 6ce8fa1693
commit 35c0666ab2
40 changed files with 50 additions and 107 deletions

View File

@@ -45,6 +45,7 @@ public class BlockFree extends Condition {
@Override
protected void removeChild(BaseClass child) {
if (child == block) block = null;
super.removeChild(child);
}
@Override

View File

@@ -122,6 +122,7 @@ public class ConditionList extends Condition implements Iterable<Condition>{
@Override
public BaseClass remove() {
LOG.debug("Removing Condition List ({}) {}",id(),this);
super.remove();
while (!conditions.isEmpty()) conditions.lastElement().remove();
return this;
@@ -134,6 +135,7 @@ public class ConditionList extends Condition implements Iterable<Condition>{
@Override
public void removeChild(BaseClass child) {
conditions.remove(child);
super.removeChild(child);
}

View File

@@ -8,11 +8,6 @@ public class PushPullTrain extends Condition {
public boolean fulfilledBy(Context context) {
return context.train().pushPull != inverted;
}
@Override
protected void removeChild(BaseClass child) {
// this class has no child elements
}
@Override
public String toString() {

View File

@@ -38,11 +38,6 @@ public class TrainHasTag extends Condition {
return super.properties(preForm, formInputs, postForm);
}
@Override
protected void removeChild(BaseClass child) {
// this class has no child elements
}
@Override
public String toString() {
if (tag == null) return "["+t("Click to setup tag")+"]";

View File

@@ -39,11 +39,6 @@ public class TrainLength extends Condition {
return super.properties(preForm, formInputs, postForm);
}
@Override
protected void removeChild(BaseClass child) {
// this class has no child elements
}
@Override
public String toString() {
return t(inverted ? "train is longer than {}" : "train is shorter than {}",maxLength) ;

View File

@@ -40,6 +40,7 @@ public class TrainSelect extends Condition {
@Override
protected void removeChild(BaseClass child) {
if (child == train) train = null;
super.removeChild(child);
}
@Override