itmo-prog-lab-4/src/story/StoryContext.java
2023-12-30 00:33:13 +03:00

33 lines
930 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package story;
import model.City;
import model.House;
public class StoryContext {
private final City city;
private final House house;
private final String storyContext;
public StoryContext(City city, House house, String storyContext) {
this.city = city;
this.house = house;
this.storyContext = storyContext;
}
// Getters and setters for city and house
public City getCity() {
return this.city;
}
public String getStoryContext() {
return this.storyContext;
}
public void gatherResidentsForStories() {
// Implement the logic for gathering residents to listen to stories
house.gatherResidents();
System.out.println("Все жители, и малыши и малышки, приходили по вечерам к " + house.getName() + " и слушали рассказы путешественников.");
}
}