implement check station in one system on find paths
This commit is contained in:
@@ -101,12 +101,12 @@ public class MarketModel {
|
||||
return BindingsHelper.observableList(analyzer.getTopPaths(balance), modeler::get);
|
||||
}
|
||||
|
||||
PathRoute getPath(SystemModel from, SystemModel to) {
|
||||
return analyzer.getPath(from.getSystem(), to.getSystem());
|
||||
PathRoute getPath(StationModel from, StationModel to) {
|
||||
return analyzer.getPath(from.getStation(), to.getStation());
|
||||
}
|
||||
|
||||
public PathRouteModel getPath(OrderModel order) {
|
||||
PathRoute p = analyzer.getPath(order.getStation().getStation().getPlace(), order.getBuyer().getStation().getPlace());
|
||||
PathRoute p = analyzer.getPath(order.getStation().getStation(), order.getBuyer().getStation());
|
||||
if (p == null) return null;
|
||||
p.getRoot().getNext().setOrder(new Order(order.getOffer().getOffer(), order.getBuyOffer().getOffer(), order.getCount()));
|
||||
return modeler.get(p);
|
||||
|
||||
@@ -82,7 +82,7 @@ public class PathRouteModel {
|
||||
}
|
||||
|
||||
public void add(OrderModel order){
|
||||
PathRoute p = market.getPath(order.getStation().getSystem(), order.getBuyer().getSystem());
|
||||
PathRoute p = market.getPath(order.getStation(), order.getBuyer());
|
||||
if (p == null) return;
|
||||
p.getRoot().getNext().setOrder(new Order(order.getOffer().getOffer(), order.getBuyOffer().getOffer(), order.getCount()));
|
||||
PathRoute head = path.getEnd();
|
||||
|
||||
@@ -103,10 +103,7 @@ public class StationModel {
|
||||
}
|
||||
|
||||
public double getDistance(StationModel other){
|
||||
Place place = station.getPlace();
|
||||
Place otherPlace = other.station.getPlace();
|
||||
if (!place.equals(otherPlace)) return station.getPlace().getDistance(other.station.getPlace());
|
||||
return (station.getDistance() + other.station.getDistance() + Math.abs(station.getDistance() - other.station.getDistance())) * 0.00000003169 / 2;
|
||||
return station.getDistance(other.station);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user