Archived
0

apply power effects on illegal items

This commit is contained in:
iMoHax
2016-03-17 17:14:25 +03:00
parent 7ce09a5135
commit ee5a56f782
5 changed files with 121 additions and 14 deletions

View File

@@ -1,6 +1,5 @@
package ru.trader.controllers;
import javafx.beans.InvalidationListener;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
@@ -253,7 +252,7 @@ public class StationEditorController {
if (entry != null){
GOVERNMENT g = government.getValue();
FACTION f = faction.getValue();
if (entry.getItem().isIllegal(f, g)){
if (entry.getItem().isIllegal(updater.getSystem(), f, g)){
styles.add(ViewUtils.ILLEGAL_ITEM_STYLE);
}
}

View File

@@ -148,8 +148,8 @@ public class ItemModel implements Comparable<ItemModel> {
item.setLegal(government, legal);
}
public boolean isIllegal(FACTION faction, GOVERNMENT government){
return item.isIllegal(faction, government);
public boolean isIllegal(SystemModel system, FACTION faction, GOVERNMENT government){
return item.isIllegal(ModelFabric.get(system), faction, government);
}
public void refresh(){

View File

@@ -109,6 +109,10 @@ public class StationUpdater {
return offers.stream().filter(o -> o.hasItem(item)).findAny();
}
public SystemModel getSystem() {
return system;
}
public StationModel getStation() {
return station;
}