|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.ucm.fdi.hysteria.game.scene.Scene
public class Scene
This class implements a way to have "characters" in the game to interact with.
Field Summary | |
---|---|
protected boolean |
_enabled
Is the scene enabled? |
protected java.lang.String |
_image
Scene image |
protected es.ucm.fdi.hysteria.game.scene.Intro |
_intro
The scene intro |
protected ReactionManager |
_reactions
The reaction manager |
protected java.util.Vector<Scene> |
_relatedToDisable
The scenes related to this one |
protected java.util.Vector<Scene> |
_relatedToEnable
The scenes related to this one |
protected es.ucm.fdi.hysteria.game.scene.TopicManager |
_topics
The topic manager |
Constructor Summary | |
---|---|
Scene(java.lang.String introText,
java.lang.String reactionDefault)
Constructor. |
|
Scene(java.lang.String introText,
java.lang.String reactionDefault,
boolean enabled)
Constructor |
|
Scene(java.lang.String introText,
java.lang.String reactionDefault,
boolean enabled,
java.lang.String image)
Constructor |
|
Scene(java.lang.String introText,
java.lang.String reactionDefault,
java.lang.String image)
Constructor |
Method Summary | |
---|---|
void |
addReaction(Reaction r)
It adds a reaction to the manager |
boolean |
addRelated(Scene s,
boolean enable)
It adds a related scene. |
void |
addTopic(Topic t)
It adds a topic to the topic Manager |
protected boolean |
checkFinished()
It checks if the scene is finished, and then, updates the related ones. |
java.lang.String |
getImage()
|
java.lang.String |
getText(int i)
It returns the text of a topic, identified by its number |
java.lang.String |
getText(java.lang.String title)
It returns the text of a topic, identified by its title |
java.util.Vector<java.lang.String> |
getTitles()
It returns all topic titles |
ItemRepository |
getTopicItems(int i)
It returns the items given by a topic, identified by its number |
ItemRepository |
getTopicItems(java.lang.String title)
It returns the items given when asking for a given topic |
boolean |
hasImage()
|
boolean |
hasItems(int i)
It returns true if a topic gives items, identified by its number |
boolean |
hasItems(java.lang.String title)
It returns true if a topic gives items, identified by its title |
boolean |
hasTopic(int i)
It checks if a topic exists, with a given number |
boolean |
hasTopic(java.lang.String s)
It checks if a topic exists, with a given title |
boolean |
introWatched()
Was the intro watched? |
boolean |
isEnabled()
Is the scene enabled? |
java.lang.String |
presentItem(Item i)
It presents a given item to the character, and returns the reaction |
boolean |
presentItemExtinguish(Item i)
|
java.lang.String |
reportIntro()
It returns the intro text |
void |
setEnabled(boolean enabled)
Sets the "enable" flag of this scene to the value given |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean _enabled
protected es.ucm.fdi.hysteria.game.scene.Intro _intro
protected es.ucm.fdi.hysteria.game.scene.TopicManager _topics
protected ReactionManager _reactions
protected java.util.Vector<Scene> _relatedToEnable
protected java.util.Vector<Scene> _relatedToDisable
protected java.lang.String _image
Constructor Detail |
---|
public Scene(java.lang.String introText, java.lang.String reactionDefault)
introText
- The intro messagereactionDefault
- The default reactionpublic Scene(java.lang.String introText, java.lang.String reactionDefault, java.lang.String image)
introText
- The intro messagereactionDefault
- The default reactionimage
- The scene imagepublic Scene(java.lang.String introText, java.lang.String reactionDefault, boolean enabled)
introText
- The intro messagereactionDefault
- The default reactionenabled
- Is the scene enabled?public Scene(java.lang.String introText, java.lang.String reactionDefault, boolean enabled, java.lang.String image)
introText
- The intro messagereactionDefault
- The default reactionenabled
- Is the scene enabled?image
- The scene imageMethod Detail |
---|
public void addTopic(Topic t)
t
- The topicpublic boolean addRelated(Scene s, boolean enable)
s
- The sceneenable
- It has to enable, or disable the scene?
public void addReaction(Reaction r)
r
- The reactionpublic boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- The valuepublic boolean introWatched()
public java.lang.String reportIntro()
public java.util.Vector<java.lang.String> getTitles()
public java.lang.String getText(int i)
i
- The topic number
public java.lang.String getText(java.lang.String title)
title
- The topic title
public boolean hasItems(int i)
i
- The topic number
public boolean hasItems(java.lang.String title)
title
- The topic title
public ItemRepository getTopicItems(int i)
i
- The topic number
public ItemRepository getTopicItems(java.lang.String title)
title
- The topic title
protected boolean checkFinished()
public boolean hasTopic(int i)
i
- The number
public boolean hasTopic(java.lang.String s)
s
- The title
public java.lang.String presentItem(Item i)
i
- The item
public boolean presentItemExtinguish(Item i)
public boolean hasImage()
public java.lang.String getImage()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |