Class starSpec

java.lang.Object
name.moore.kevin.ze.XMLdata.XMLbase
name.moore.kevin.ze.XMLdata.specs.starSpec

public class starSpec extends XMLbase
The read-only properties of a particular type or classification (eg class "M") of a star. These properties are fixed and thus have no setter methods since there is no in-game reason to change them or create them.

Objects are initialised by loading XML via XStream.

Use the real Morgan–Keenan (MK) stellar classification system. wikipedia

Author:
Kevin Moore <dev@kevin.moore.name>
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • size

      private Float size
      The relative size of a star of this specification.
    • texture

      private File texture
      The name of the texture resource associated with this spec eg "bluegiant.jpg". This is added to a 'display' component.
      See Also:
      display
  • Constructor Details

    • starSpec

      public starSpec()
  • Method Details

    • getSize

      public Float getSize()
      Returns:
    • getTexture

      public File getTexture()
      Returns:
    • readResolve

      protected Object readResolve()
      Description copied from class: XMLbase
      Called 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:
      readResolve in class XMLbase
      Returns:
      null if we can't create a valid object
    • getEntityClass

      public Class getEntityClass()
      Description copied from class: XMLbase
      Derived 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:
      getEntityClass in class XMLbase
      Returns: