package observer; import java.util.AbstractMap; import java.util.Map; public class Orcs { private Logger logger; private Map.Entry<Integer, String> value = new AbstractMap.SimpleEntry<>(0,"orcs"); public void updateWeather(int weather) { Map.Entry<Integer, String> temp_if22; if ((weather==this.value.getKey())) { temp_if22 = this.value; } else { return; } value = temp_if22; this.logger.updateOrcs(value); } public Orcs(Logger logger) { this.logger = logger; } public void update(String type, int id) { this.value = new AbstractMap.SimpleEntry<>(id, type); this.logger.updateOrcs(value); this.logger.updateOrcs(value); } public Map.Entry<Integer, String> getValue() { return value; } }