Update Building.java
This commit is contained in:
parent
d25981a18d
commit
c98ae20599
1 changed files with 8 additions and 10 deletions
|
@ -116,17 +116,15 @@ public class Building extends MapObject {
|
||||||
String sname = getName2();
|
String sname = getName2();
|
||||||
|
|
||||||
if (getInterpolationType() == BuildingInterpolation.ALPHABETIC && num == numB) {
|
if (getInterpolationType() == BuildingInterpolation.ALPHABETIC && num == numB) {
|
||||||
char hCh = hno.charAt(hno.length() - 1);
|
int hint = (int) hno.charAt(hno.length() - 1);
|
||||||
char fCh = fname.charAt(fname.length() - 1);
|
int fch = (int) fname.charAt(fname.length() - 1);
|
||||||
char sCh = sname.charAt(sname.length() - 1);
|
int sch = sname.charAt(sname.length() - 1);
|
||||||
int h = Character.getNumericValue(hCh);
|
if (fch == sch) {
|
||||||
int f = Character.getNumericValue(fCh);
|
return -1;
|
||||||
int s = Character.getNumericValue(sCh);
|
|
||||||
if (sCh > fCh) {
|
|
||||||
return ((float) h - f) / (((float) s - f));
|
|
||||||
}
|
}
|
||||||
if (sCh < fCh) {
|
float res = ((float) hint - fch) / (((float) sch - fch));
|
||||||
return ((float) f - h) / (((float) f - s));
|
if (res > 1 || res < -1) {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (num >= numB) {
|
if (num >= numB) {
|
||||||
|
|
Loading…
Reference in a new issue