bugfix
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>de.srsoftware</groupId>
|
||||
<artifactId>web4rail</artifactId>
|
||||
<version>0.11.25</version>
|
||||
<version>0.11.26</version>
|
||||
<name>Web4Rail</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>Java Model Railway Control</description>
|
||||
|
||||
@@ -33,4 +33,12 @@ public class Range extends BaseClass{
|
||||
public String toString() {
|
||||
return min+"…"+max;
|
||||
}
|
||||
|
||||
public void validate() {
|
||||
if (min>max) {
|
||||
int dummy = min;
|
||||
min = max;
|
||||
max = dummy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,13 +93,11 @@ public abstract class Block extends StretchableTile implements Comparable<Block>
|
||||
|
||||
public WaitTime setMax(Direction dir,int max) {
|
||||
get(dir).max = max;
|
||||
if (get(dir).min > max) setMin(dir,max);
|
||||
return this;
|
||||
}
|
||||
|
||||
public WaitTime setMin(Direction dir,int min) {
|
||||
get(dir).min = min;
|
||||
if (get(dir).max > min) setMax(dir,min);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -112,6 +110,11 @@ public abstract class Block extends StretchableTile implements Comparable<Block>
|
||||
public String toString() {
|
||||
return "WaitTime("+tag+", "+dirs+")";
|
||||
}
|
||||
|
||||
public void validate() {
|
||||
for (Entry<Direction, Range> entry: dirs.entrySet()) entry.getValue().validate();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -376,6 +379,7 @@ public abstract class Block extends StretchableTile implements Comparable<Block>
|
||||
} else wt.setMax(dir, Integer.parseInt(val));
|
||||
}
|
||||
}
|
||||
for (WaitTime wt: waitTimes) wt.validate();
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user