Newer
Older
GeneratedDesignPatternsByDTRAM / DTRAM / src / observer / Observer.java
package observer;

import java.util.Map;

public class Observer {
	private Logger logger;
	private Orcs orcs;
	private Hobbits hobbits;
	private Weather weather;
	public Observer() {
		logger = new Logger();
		orcs = new Orcs(logger);
		hobbits = new Hobbits(logger);
		weather = new Weather(orcs,hobbits);
	}
	public void update(String type, int id) {
		this.hobbits.update(type, id);
		this.orcs.update(type, id);
	}
	public void timePasses() {
		this.weather.timePasses();
	}
	public Map.Entry<Integer, String> getHobbits() {
		return hobbits.getValue();
	}
	public Map.Entry<Integer, String> getOrcs() {
		return orcs.getValue();
	}
	public String getLogger() {
		return logger.getValue();
	}
	public int getWeather() {
		return weather.getValue();
	}
}