diff --git a/DTRAM/src/observer/Hobbits.java b/DTRAM/src/observer/Hobbits.java new file mode 100644 index 0000000..9fc6226 --- /dev/null +++ b/DTRAM/src/observer/Hobbits.java @@ -0,0 +1,30 @@ +package observer; + +import java.util.AbstractMap; +import java.util.Map; + +public class Hobbits { + private Logger logger; + private Map.Entry value = new AbstractMap.SimpleEntry<>(1,"hobbits"); + public void updateWeather(int weather) { + Map.Entry temp_if23; + if ((weather==this.value.getKey())) { + temp_if23 = this.value; + } else { + return; + } + value = temp_if23; + this.logger.updateHobbits(value); + } + public Hobbits(Logger logger) { + this.logger = logger; + } + public void update(String type, int id) { + this.value = new AbstractMap.SimpleEntry<>(id, type); + this.logger.updateHobbits(value); + this.logger.updateHobbits(value); + } + public Map.Entry getValue() { + return value; + } +} \ No newline at end of file