|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.gatech.cs2335.lemmings.file.LevelReader
Allows us to read level data, maps and other nice stuff. The string passed in to any of the "load" methods is basically the id of the level. The loader then tests if there is a directory with the same name in the levels list. If there is one, then it loads the level from it. If there is no such directory, then is appends a .lmf extension to it and checks wether there is a file with that name. If there is, it extracts the file and then loads the level from that. If there is no such file, then the loading fails and null is returned.
| Method Summary | |
java.lang.String |
findNextLevel(java.lang.String id)
Given the id of a level, finds the next level. |
static LevelReader |
getInstance()
Access method for the INSTANCE property. |
java.lang.String[] |
getLevelList()
Returns the list of all levels available. |
Level |
loadLevel(java.lang.String name)
Loads the level with the name specified if possible. |
LevelData |
loadLevelData(java.lang.String name)
Loads the data for the level with the specified name. |
Map |
loadMap(java.lang.String name)
Loads the map for the level with the specified name. |
static void |
main(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static LevelReader getInstance()
public java.lang.String[] getLevelList()
public java.lang.String findNextLevel(java.lang.String id)
id - a String value
String valuepublic Level loadLevel(java.lang.String name)
name - The name of the level to load.
public Map loadMap(java.lang.String name)
name - a String value
Map valuepublic LevelData loadLevelData(java.lang.String name)
name - The name of the level to load the data for.
public static void main(java.lang.String[] args)
args - args
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||