Archived
0

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:
iMoHax
2016-03-14 16:23:49 +03:00
parent 01fc65ec94
commit 5c482b16f2
9 changed files with 94 additions and 20 deletions

View File

@@ -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);

View File

@@ -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);