apply power effects on illegal items
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(){
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user