Class AcademyCampusLocation

java.lang.Object
mekhq.campaign.location.AcademyCampusLocation
All Implemented Interfaces:
ILocation, IPlace

public class AcademyCampusLocation extends Object implements IPlace
Represents a specific academy campus as an ILocation.

Each AcademyCampusLocation is a lightweight node in the location tree, serving as a child of a FixedLocation at the same planetary system. Personnel enrolled at the campus can be attached as children of this node.

  • Field Details

    • CAMPUS_REFERENCE_TYPE

      public static final String CAMPUS_REFERENCE_TYPE
      Discriminator for a campus anchored to a fixed planetary system, as a serialized ILocation reference.
      See Also:
    • LOCAL_CAMPUS_REFERENCE_TYPE

      public static final String LOCAL_CAMPUS_REFERENCE_TYPE
      Discriminator for a local (home-school or unit-education) campus that travels with its parent, as a serialized ILocation reference.
      See Also:
  • Constructor Details

    • AcademyCampusLocation

      public AcademyCampusLocation(String academySet, String academyName)
  • Method Details

    • getAcademySet

      public String getAcademySet()
    • getAcademyName

      public String getAcademyName()
    • getAcademy

      @Nullable public Academy getAcademy()
    • getLocationNode

      @Nonnull public LocationNode getLocationNode()
      Specified by:
      getLocationNode in interface ILocation
    • getPersonnel

      public Personnel getPersonnel()
      Description copied from interface: IPlace
      Returns the personnel roster owned by this place, or null if this place does not own one.

      Overrides ILocation.getPersonnel() to stop the upward tree traversal.

      Specified by:
      getPersonnel in interface ILocation
      Specified by:
      getPersonnel in interface IPlace
    • writeToXML

      public void writeToXML(PrintWriter pw, int indent)
    • locationReferenceType

      public String locationReferenceType()
      Description copied from interface: ILocation
      The discriminator identifying this location's kind within a serialized reference, or null if this type cannot be referenced. Concrete referable types return their own LOCATION_REFERENCE_TYPE constant.
      Specified by:
      locationReferenceType in interface ILocation
    • writeReferenceIdentity

      public void writeReferenceIdentity(PrintWriter pw, int indent)
      Description copied from interface: ILocation
      Writes the identity tags (ids/names) that ILocation.resolveReferenceFromXML(mekhq.campaign.Campaign, org.w3c.dom.Node) needs to resolve a reference of this kind. The default writes nothing; referable types with identity beyond their discriminator override this.
      Specified by:
      writeReferenceIdentity in interface ILocation
    • resolveCampusReference

      @Nullable public static ILocation resolveCampusReference(Campaign campaign, Node node)
      Resolves a "campus" reference (academy anchored to a fixed planetary system).
    • resolveLocalCampusReference

      @Nullable public static ILocation resolveLocalCampusReference(Campaign campaign, Node node)
      Resolves a "localCampus" reference (home-school or unit-education campus under the campaign).
    • containsPendingPersonId

      public boolean containsPendingPersonId(UUID personId)
      Returns true if personId is in the pending reconnection list (non-destructive).
    • drainPendingPersonIds

      public List<UUID> drainPendingPersonIds()
      Returns and clears the person UUIDs read from XML, for use during post-load reconnection.
    • generateInstanceFromXML

      @Nullable public static AcademyCampusLocation generateInstanceFromXML(Node wn)