Class starmap
It is contained in a distinct XML file from the gamefile file so we can reuse the same starmap in different games. Parsing is done through XStream. The map is a list of stars, planets with their coordinates and types.
Once loaded the lists of stars and planets will need converting into a collection of entities with their components. There is an assumption that this geographic information will be loaded early in preparing a gamefile but after specifications have been loaded. This is so that when a planet is loaded in the starmap, its associated planetSpec has already been loaded.
Ownership of such planets is not recorded here - that's in the gamefile savefile
- Author:
- Kevin Moore
<dev@kevin.moore.name>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static org.slf4j.LoggerRequired element to specify each planet and what it's orbiting.Required element to specify each star. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class name.moore.kevin.ze.XMLdata.XMLbase
defaultXMLmessage, duplicatedXMLmessage, getDescription, getKey, getSpec, missingXMLmessage
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
stars
Required element to specify each star. -
planets
Required element to specify each planet and what it's orbiting.
-
-
Constructor Details
-
starmap
public starmap()
-
-
Method Details
-
getStars
- Returns:
-
getPlanets
- Returns:
-
readResolve
Description copied from class:XMLbaseCalled automatically when loading from XML as part of JDK serialisation.Used to do some validation of that incoming XML by asserting that properties are set and have defaults as required. Output warning messages if a default is applied. Output error messages if a required XML element is missing and return null to indicate an invalid object.
- Overrides:
readResolvein classXMLbase- Returns:
- null if we can't create a valid object
-
getEntityClass
Description copied from class:XMLbaseDerived classes have to override this and say what class eg engine.class they are. This allows us to use this base class but discover the derived class.- Specified by:
getEntityClassin classXMLbase- Returns:
-