public class Chapter extends java.lang.Object implements SaveElement
Constructor and Description |
---|
Chapter(java.lang.String id,
java.util.List<SavedScenario> savedScenarios,
Scenario startScenario,
org.newdawn.slick.GameContainer gc)
Chapter constructor
|
Chapter(java.lang.String id,
java.lang.String startScenario,
org.newdawn.slick.GameContainer gc)
Chapter constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsScenario(java.lang.String scenarioId)
Checks if this chapter contains scenario with specified ID
|
Scenario |
getActiveScenario()
Returns active scenario
|
Character |
getCharacter(java.lang.String serial)
Returns character with specified ID from all spawned character in this chapter
|
java.lang.String |
getId() |
org.w3c.dom.Element |
getSave(org.w3c.dom.Document doc)
Parses object to XML document element
|
Scenario |
getScenario(java.lang.String scenarioId,
org.newdawn.slick.GameContainer gc)
Returns scenario with specified ID from scenarios list
|
java.util.List<Scenario> |
getScenarios()
Returns all loaded(visited) scenarios of this chapter
|
Targetable |
getTObject(java.lang.String tObId)
Returns targetable object with specified ID from all spawned object in this chapter
|
boolean |
removeTObject(Targetable obToRemove)
Removes specified targetable object from chapter
|
boolean |
setScenario(java.lang.String scenarioId,
org.newdawn.slick.GameContainer gc)
Sets scenario with specified ID as active scenario
|
java.lang.String |
toString() |
public Chapter(java.lang.String id, java.lang.String startScenario, org.newdawn.slick.GameContainer gc)
id
- Chapter IDstartScenario
- Start scenariopublic Chapter(java.lang.String id, java.util.List<SavedScenario> savedScenarios, Scenario startScenario, org.newdawn.slick.GameContainer gc) throws java.lang.NumberFormatException, org.w3c.dom.DOMException, org.newdawn.slick.SlickException, java.io.IOException, java.awt.FontFormatException
id
- Chapter IDscenarios
- List of scenariosstartScenario
- Start scenariojava.awt.FontFormatException
java.io.IOException
org.newdawn.slick.SlickException
org.w3c.dom.DOMException
java.lang.NumberFormatException
public java.lang.String getId()
public Scenario getScenario(java.lang.String scenarioId, org.newdawn.slick.GameContainer gc)
scenarioId
- String with desired scenario IDpublic boolean containsScenario(java.lang.String scenarioId)
scenarioId
- String with scenario IDpublic Scenario getActiveScenario()
public java.util.List<Scenario> getScenarios()
public Character getCharacter(java.lang.String serial)
serial
- Character serial IDpublic Targetable getTObject(java.lang.String tObId)
tObId
- Targetable object IDpublic boolean removeTObject(Targetable obToRemove)
obToRemove
- Targetable object to removepublic boolean setScenario(java.lang.String scenarioId, org.newdawn.slick.GameContainer gc)
scenarioId
- Scenario IDpublic org.w3c.dom.Element getSave(org.w3c.dom.Document doc)
SaveElement
getSave
in interface SaveElement
doc
- XML document for save gamepublic java.lang.String toString()
toString
in class java.lang.Object