Package name.moore.kevin.ze.XMLdata
This package is focused on reading XML files into objects. XStream is used to parse the XML into java objects. XStream makes use of annotations to connect the XML elements to java variables. Most of the classes are a list of annotated member variables with converters specified where needed. The presence of the @XStreamAlias annotation shows the XML element that class will process.
Once the XML file is read these objects are used to build the actual entities in the entity-component-systems. Once this has been done, they can be discarded.
They all derive from XMLbase which provides common XML attributes 'key' and the element 'description'.
The 'key' attribute, where used will refer to the unique Name of another entity, so for example key="H01" is a reference to the
entity with a Name component of "H01". In this way we can build objects that are compositions of other objects.
Specifications
A specialist type of configuration file is a specification. These are fixed blueprints or unchanging properties of something such as mass. By convention these have a ...Spec filename. Some properties will have measurement units associated with them eg Joules for energy. This provides a consistency to how the values are used - the units used are part of the JScience library. Processing these from XML requires custom converters.
-
Class SummaryClassDescriptionEngine provide power for hulls (so they can move), shields and weapons.Process a <faction> XML element into an object.Hulls provide a container to allow other components to be collected together into a ship.Industry builds things.Process the XML <orbiting key="Sol">3</orbiting> into an object.Process a <planet> XML element into an entity and components.Process the XML of form <reference key="Sol">3</reference> into an object.Shields absorb incoming damage.Process a
<ship>XML element into an entity and components.Shipyards are in orbit around planets and build ships and hulls.Simple placeholder class for now.A star has a unique key eg "Sol", type (a stellar spec ) optional description and may have planets associated with it.A starmap contains the unchanging geographical positions in space of the planets (and other such?) stellar features.Weapon that directs energy to a target to deliver damage.XML data is parsed by XStream into the appropriate data object.