package pelletQuest.main;
import pelletQuest.database.World;
import org.newdawn.slick.*;
import org.newdawn.slick.state.*;
import org.newdawn.slick.state.transition.FadeInTransition;
import org.newdawn.slick.state.transition.FadeOutTransition;
import org.newdawn.slick.util.xml.*;
public class GameLoadState extends BasicGameState {
public static final int ID = 5;
public int getID() { return ID; }
public void init(GameContainer container, StateBasedGame game) throws SlickException {
}
public void enter(GameContainer container, StateBasedGame game) throws SlickException {
XMLParser parser = new XMLParser();
XMLElement root = parser.parse("data/newgameData.xml");
World.loadWorldData(root);
}
public void leave (GameContainer container, StateBasedGame game) {
}
public void render(GameContainer container, StateBasedGame game, Graphics g) throws SlickException {
}
public void update(GameContainer container, StateBasedGame game, int delta) throws SlickException {
game.enterState(PlayState.ID, new FadeOutTransition(), new FadeInTransition());
}
}