public int getResourceModifier(Resource resource, boolean resourceExists) {
int resourceModifier = 0;
Iterator<Property> propertyIterator = getProperties().iterator();
while (propertyIterator.hasNext()) {
Property property = propertyIterator.next();
if (property instanceof ModifyResourceProduction) {
ModifyResourceProduction modifyResourceProduction = (ModifyResourceProduction) property;
if (resource.equals(modifyResourceProduction.getResource())) {
if (!modifyResourceProduction.isModifyingOnlyIfResourceExists() || (modifyResourceProduction.isModifyingOnlyIfResourceExists() && resourceExists)) {
resourceModifier = resourceModifier + modifyResourceProduction.getModifier();