public void update() { if (currentWeather == raining) { rain.update(x, y); } else if (currentWeather == sunny) { sunnyDay.update(x, y); } else if (currentWeather == hellsky) { hell.update(x, y); } }
public Weather(float x, float y) { rain = new Rain(); sunnyDay = new Sunny(); hell = new Hell(); this.x = x; this.y = y; rain.update(x, y); sunnyDay.update(x, y); hell.update(x, y); }