From f0a48750fcd3946a9f4f5b2285a977faa54383d4 Mon Sep 17 00:00:00 2001 From: Gurkenlabs Date: Tue, 27 Feb 2018 23:45:06 +0100 Subject: [PATCH] Revert unintentionally pushed change to the file extension. Add a version to the GameFile xml. --- src/de/gurkenlabs/litiengine/GameFile.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/de/gurkenlabs/litiengine/GameFile.java b/src/de/gurkenlabs/litiengine/GameFile.java index 6e4fb409c..9562ffc38 100644 --- a/src/de/gurkenlabs/litiengine/GameFile.java +++ b/src/de/gurkenlabs/litiengine/GameFile.java @@ -21,6 +21,7 @@ import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; +import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; @@ -36,10 +37,14 @@ @XmlRootElement(name = "game") public class GameFile implements Serializable { private static final Logger log = Logger.getLogger(GameFile.class.getName()); - public static final String FILE_EXTENSION = "ltx"; + public static final String FILE_EXTENSION = "env"; + public static final float CURRENT_VERSION = 1.0f; private static final long serialVersionUID = -2101786184799276518L; + @XmlAttribute(name = "version") + private float version; + @XmlElementWrapper(name = "maps") @XmlElement(name = "map") private List maps; @@ -199,5 +204,9 @@ void beforeMarshal(Marshaller m) { } this.tilesets = distinctTilesets; + + if (this.version == 0) { + this.version = CURRENT_VERSION; + } } }