itmo-prog-lab-4/src/characters/Traveler.java

24 lines
650 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 characters;
import enums.CharacterType;
import story.StoryContext;
public class Traveler extends Character {
public Traveler(String name) {
super(CharacterType.TRAVELER, name);
}
// Traveler can tell stories about his adventures and listen to stories about the city, but dont ask questions
@Override
public String listen(StoryContext context) {
return name + " слушает историю о " + context.getStoryContext();
}
@Override
public String converse(StoryContext context, String subject) {
return name + " рассказывает историю о " + subject;
}
}