Archived
0

implement illegal items indication on vendor editor screen

This commit is contained in:
iMoHax
2016-03-15 14:54:41 +03:00
parent 400f600b2c
commit be2dd6c95e
9 changed files with 53 additions and 6 deletions

View File

@@ -12,6 +12,10 @@ public interface Item extends Comparable<Item> {
default boolean isIllegal(Vendor vendor){
FACTION faction = vendor.getFaction();
GOVERNMENT government = vendor.getGovernment();
return isIllegal(faction, government);
}
default boolean isIllegal(FACTION faction, GOVERNMENT government){
if (faction != null && getLegalFactions().contains(faction)) return false;
if (government != null && getLegalGovernments().contains(government)) return false;
return faction != null && getIllegalFactions().contains(faction) ||