|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for classes that can create or load game maps. Game maps are usually loaded on a background worker thread, and people waiting for the map to load are notified when the map is ready. The BackgroundMapLoader class that performs this can take an instance of a GameMapLoader to perform the map creation.
Method Summary | |
boolean |
inMapEditor()
Returns true if we've been told we're loading the map inside the Map Editor. |
GameMap |
loadMap(java.lang.String filename)
Reads a map from a Wyvern XML map file. |
void |
setMapEditor(boolean editor)
Sets whether the map is being loaded within the Map Editor |
void |
throwExceptions(boolean exceptions)
Turns exception-throwing on or off. |
boolean |
throwingExceptions()
Returns true if this GameMapLoader is configured to throw exceptions when it encounters errors loading a map. |
Method Detail |
public GameMap loadMap(java.lang.String filename) throws java.lang.Exception
filename
- the full path to the file. If it ends with
".py", it'll be instantiated as a python map.
various
- exceptions if the map couldn't be loaded,
and the the GameMapLoader is configured to throw exceptions
when there are errors loading the map.
java.lang.Exception
public void throwExceptions(boolean exceptions)
Note: if the map header in the .map file has an "errors-ok" boolean property, it will continue without throwing any exceptions if it fails to load a particular archetype in the map. "errors-ok" maps will only throw exceptions if the map was fundamentally not loadable, e.g. if the map class couldn't be loaded, or the map's XML is corrupted.
public boolean throwingExceptions()
public boolean inMapEditor()
public void setMapEditor(boolean editor)
editor
- true if being loaded into Map Editor, false if
being loaded into an actual game session. If true, sets the
transient property "@mapedit" on the loaded maps.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |