hide incorrect offers
- illegal buy offers, - illegal sell offers if haven't black market, - legal offers if haven't market
This commit is contained in:
@@ -131,14 +131,22 @@ public class StationModel {
|
||||
return market.getModeler().get(station.getPlace());
|
||||
}
|
||||
|
||||
public List<OfferModel> getSells() {
|
||||
public List<OfferModel> getAllSells() {
|
||||
return station.getAllSellOffers().stream().map(this::asModel).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<OfferModel> getBuys() {
|
||||
public List<OfferModel> getSells() {
|
||||
return station.getSellOffers().map(this::asModel).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<OfferModel> getAllBuys() {
|
||||
return station.getAllBuyOffers().stream().map(this::asModel).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<OfferModel> getBuys() {
|
||||
return station.getBuyOffers().map(this::asModel).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public OfferModel add(OFFER_TYPE type, ItemModel item, double price, long count){
|
||||
OfferModel offer = asModel(station.addOffer(type, ModelFabric.get(item), price, count), item);
|
||||
LOG.info("Add offer {} to station {}", offer, station);
|
||||
|
||||
@@ -72,8 +72,8 @@ public class StationUpdater {
|
||||
for (SERVICE_TYPE service : station.getServices()) {
|
||||
serviceProperty(service).set(true);
|
||||
}
|
||||
station.getSells().forEach(this::fillOffer);
|
||||
station.getBuys().forEach(this::fillOffer);
|
||||
station.getAllSells().forEach(this::fillOffer);
|
||||
station.getAllBuys().forEach(this::fillOffer);
|
||||
} else {
|
||||
name.setValue("");
|
||||
type.setValue(null);
|
||||
|
||||
Reference in New Issue
Block a user