Towers, health
[AntiTD.git] / src / se / umu / cs / dit06ajnajs / AntiTD.java
blobecff1fa46568b0a2f788b78c1d9e86f1c1952e42
1 package se.umu.cs.dit06ajnajs;
3 import java.io.File;
4 import java.io.IOException;
5 import java.net.URL;
6 import java.util.List;
7 import java.util.logging.Logger;
8 import org.jdom.JDOMException;
9 import se.umu.cs.dit06ajnajs.map.Level;
10 import se.umu.cs.dit06ajnajs.util.LevelsXMLParser;
12 public class AntiTD {
13 public static final int SQUARE_SIZE = 45;
14 private static final URL DEFAULT_LEVELS_XML
15 = AntiTD.class.getResource("/resources/levels.xml");
17 /**
18 * TODO: Doc
20 * @param args
22 public static void main(String[] args) {
23 Logger.getLogger("AntiTD").setLevel(java.util.logging.Level.INFO);
25 System.out.println("******* THIS IS THE START *******");
27 try {
28 List<Level> levels;
30 if (args.length == 1) {
31 levels = LevelsXMLParser.parse(new File(args[0]));
32 } else {
33 levels = LevelsXMLParser.parse(DEFAULT_LEVELS_XML);
35 // TODO change
36 new ATDController(levels);
37 } catch (IOException e) {
38 // TODO - fix error message
39 e.printStackTrace();
40 System.exit(-1);
41 } catch (JDOMException e) {
42 // TODO - fix error message, invalid xml...
43 System.err.println("Error parsing XML-file containing level information: ");
44 System.err.println(e.getMessage());
45 System.exit(-1);